npm WARN deprecated ngmin: use ng-annotate instead

Home / AngularJS / npm WARN deprecated ngmin: use ng-annotate instead


This article describes how to replace the deprecated ngmin with ng-annotate.

ngmin used to be a popular AngularJS application pre-minifier.  Though it is now deprecated.

message: npm WARN deprecated ngmin@0.5.0: use ng-annotate instead

cause: ngmin is no longer maintained, you should use ng-annotate instead.

solution: Migrate from ngmin to ng-annotate:

  • ng-annotate -a is similar to ngmin (use stdin and stdout).
  • ng-annotate -a in.js -o out.js is similar to ngmin in.js out.js.

– Installation:


Grunt users can migrate easily by installing grunt-ng-annotate and replacing ngmin with ngAnnotate in their Gruntfile.

– Install grunt-ng-annotate:
    Start a shell at the folder where gruntfile.js is located and execute:

– Modify your gruntfile.js: replace any occurrence of ngmin in ngAnnotate:

Done!