I'm new to Grunt and I'm having trouble setting up a project with new plugins.
So far I have:
- installed grunt-cli globally
- installed grunt-init globally
- downloaded the gruntfile template from the GIT repository
- created a new directory 'test' and navigated to the directory in Terminal
- created a new grunt project from the template (grunt-init gruntfile)
- installed the project dependencies (npm install)
This all works great, however I want to use a different uglify plugin so, still in the 'test' directory, I run:
npm install uglify-js --save-dev As I'm not using the global flag, the plugin downloads to test/node_modules directory as expected, existing at test/node_modules/uglify-js. The package.json file has been updated with the additional dependency:
"uglify-js": "^2.4.15" I then edit Gruntfile.js, adding
grunt.loadNpmTasks('uglify-js'); And change
grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']); To
grunt.registerTask('default', ['concat', 'uglify-js']); I run
npm install to ensure all dependencies are downloaded, but now when I run the grunt task I get this error:
Local Npm module "uglify-js" not found. Is it installed? Warning: Task "uglify-js" not found. Use --force to continue. Anyone have any idea what I'm doing wrong?
Mac OS X 10.8.5, Node v0.10.32