node.js - Grunt - npm module not found -


i'm new grunt , i'm having trouble setting project new plugins.

so far have:

  1. installed grunt-cli globally
  2. installed grunt-init globally
  3. downloaded gruntfile template git repository
  4. created new directory 'test' , navigated directory in terminal
  5. created new grunt project template (grunt-init gruntfile)
  6. installed project dependencies (npm install)

this works great, want use different uglify plugin so, still in 'test' directory, run:

npm install uglify-js --save-dev 

as i'm not using global flag, plugin downloads test/node_modules directory expected, existing @ test/node_modules/uglify-js. package.json file has been updated additional dependency:

"uglify-js": "^2.4.15" 

i 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 dependencies downloaded, when run grunt task error:

local npm module "uglify-js" not found. installed? warning: task "uglify-js" not found. use --force continue. 

anyone have idea i'm doing wrong?

mac os x 10.8.5, node v0.10.32

if want use uglifyjs whit grunt, should use grunt-contrib-uglify. install with:

npm install grunt-contrib-uglify --save-dev 

enable inside gruntfile.js:

grunt.loadnpmtasks('grunt-contrib-uglify'); 

and run task:

grunt uglify 

see docs more information.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -