2014-01-15 86 views
1

这可能是一个小菜鸟问题,但我真的很困惑和沮丧。很多npm装置真的是越野车或我错过了什么?安装节点包的错误

这一次,我已经试过

npm install grunt-contrib-imagemin -g 

,其结果是

 
... 
npm http 304 http://registry.npmjs.org/cryptiles 
npm http 304 http://registry.npmjs.org/graceful-fs 

> [email protected] postinstall /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle 
> node lib/check.js 


events.js:72 
     throw er; // Unhandled 'error' event 
      ^
Error: connect ECONNREFUSED 
    at errnoException (net.js:901:11) 
    at Object.afterConnect [as oncomplete] (net.js:892:19) 

> [email protected] postinstall /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/optipng-bin 
> node lib/check.js 



module.js:340 
    throw err; 
     ^
Error: Cannot find module 'json-stringify-safe' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Module.require (module.js:364:17) 
    at require (module.js:380:17) 
    at Object. (/usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/request.js:19:22) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:364:17) 
npm ERR! EEXIST, mkdir '/usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/mout/random' 
File exists: /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/mout/random 
Move it away, and try again. 
npm ERR! System Darwin 12.5.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib-imagemin" "-g" 
npm ERR! cwd /Users/dmitrizaitsev/Dropbox/Priv/APP 
npm ERR! node -v v0.10.24 
npm ERR! npm -v 1.3.21 
npm ERR! path /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/mout/random 
npm ERR! fstream_path /usr/local/lib/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! code EEXIST 
npm ERR! errno 47 
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23 
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53 
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) 
npm ERR! [email protected]4 postinstall: `node lib/check.js` 
npm ERR! Exit status 8 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script. 
npm ERR! This is most likely a problem with the gifsicle package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node lib/check.js 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls gifsicle 
npm ERR! There is likely additional logging output above. 

npm ERR! System Darwin 12.5.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib-imagemin" "-g" 
npm ERR! cwd /Users/dmitrizaitsev/Dropbox/Priv/APP 
npm ERR! node -v v0.10.24 
npm ERR! npm -v 1.3.21 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/dmitrizaitsev/Dropbox/Priv/APP/npm-debug.log 
npm ERR! not ok code 0 

任何帮助,什么是怎么回事?

回答