如何解决安装grunt-contib-uglify的错误

我正在尝试安装模块grunt-contrib-uglify,并以下面的错误结束:

[james@linux tmp]npm install grunt-contrib-uglify --save-dev npm WARN package.json example-project@0.1.0 No description npm WARN package.json example-project@0.1.0 No repository field. npm WARN package.json example-project@0.1.0 No README data npm http GET https://registry.npmjs.org/grunt-contrib-uglify npm http 200 https://registry.npmjs.org/grunt-contrib-uglify npm http GET https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.4.0.tgz npm http 200 https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.4.0.tgz npm http GET https://registry.npmjs.org/uglify-js npm http GET https://registry.npmjs.org/maxmin npm http GET https://registry.npmjs.org/chalk npm http 304 https://registry.npmjs.org/chalk npm ERR! Error: No compatible version found: chalk@'^0.4.0' npm ERR! Valid install targets: npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0"] npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:719:10) npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:638:10 npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7) npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7 npm ERR! at Object.oncomplete (fs.js:107:15) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 2.6.32-358.el6.x86_64 npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "grunt-contrib-uglify" "--save-dev" npm ERR! cwd /export/home/james/tmp npm ERR! node -v v0.10.15 npm ERR! npm -v 1.3.5 npm http 200 https://registry.npmjs.org/uglify-js npm http 200 https://registry.npmjs.org/maxmin npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /export/home/james/tmp/npm-debug.log npm ERR! not ok code 0 

任何线索这是关于什么?

       

网上收集的解决方案 "如何解决安装grunt-contib-uglify的错误"

尝试如下:

  1) npm install -g grunt-cli 

这将把grunt命令放在你的系统path中,允许它从任何目录运行。

请注意,安装grunt-cli不会安装Grunt任务运行器! Grunt CLI的工作很简单:运行已安装在Gruntfile旁边的Grunt版本。 这允许多个版本的Grunt被同时安装在同一台机器上。

  2) npm install grunt --save-dev 

将Grunt和gruntplugins添加到现有的package.json最简单的方法是使用命令npm install –save-dev。 这不仅将在本地安装,而且会自动添加到devDependencies部分,使用代字号范围。

进一步的帮助请点击此链接

http://gruntjs.com/getting-started