grunt: Warning: Task “ngAnnotate” not found. Use –force to continue.



“Warning: Task “ngAnnotate” not found. Use –force to continue.” during “grunt dist” or “grunt build”

If you get this warning when you execute a grunt build or grunt distcommand you could check if the grunt-ng-annotate package is installed locally and added to your package dev dependencies.

An easier way is just to execute the install command again.
Go to the project root folder (where the gruntfile.js is located) and execute:

– Be sure not to add the -g argument as this would install the package globally instead of locally.
– Be sure to add the --save-dev argument as this will add the package to the devDependencies list in the package.json file of your project. This is required for the grunt build task to work.

Now retry the grunt build or grunt distcommand.