Node.js 安装节点包时出错
这可能是一个很难回答的问题,但我真的被困住了,很沮丧。很多npm安装是否真的有问题,或者我遗漏了什么 这次我试过了Node.js 安装节点包时出错,node.js,package,npm,Node.js,Package,Npm,这可能是一个很难回答的问题,但我真的被困住了,很沮丧。很多npm安装是否真的有问题,或者我遗漏了什么 这次我试过了 npm install grunt-contrib-imagemin -g 结果是 ... npm http 304 http://registry.npmjs.org/cryptiles npm http 304 http://registry.npmjs.org/graceful-fs > gifsicle@0.1.4 postinstall /usr/local/lib/
npm install grunt-contrib-imagemin -g
结果是
...
npm http 304 http://registry.npmjs.org/cryptiles
npm http 304 http://registry.npmjs.org/graceful-fs
> gifsicle@0.1.4 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)
> optipng-bin@0.3.1 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! gifsicle@0.1.4 postinstall: `node lib/check.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the gifsicle@0.1.4 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
...
npm http 304http://registry.npmjs.org/cryptiles
npm http 304http://registry.npmjs.org/graceful-fs
> gifsicle@0.1.4postinstall/usr/local/lib/node_modules/grunt contrib imagemin/node_modules/image min/node_modules/gifsicle
>节点lib/check.js
events.js:72
投掷者;//未处理的“错误”事件
^
错误:连接错误
在errnoException(net.js:901:11)
at Object.afterConnect[as oncomplete](net.js:892:19)
>optipng-bin@0.3.1postinstall/usr/local/lib/node_modules/grunt contrib imagemin/node_modules/image min/node_modules/optipng bin
>节点lib/check.js
module.js:340
犯错误;
^
错误:找不到模块“json stringify safe”
在Function.Module.\u解析文件名(Module.js:338:15)
在Function.Module.\u加载(Module.js:280:25)
at Module.require(Module.js:364:17)
根据需要(模块js:380:17)
反对。(/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)
在模块处编译(Module.js:456:26)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:312:12)
at Module.require(Module.js:364:17)
npm错误!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'
文件存在:/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错误!达尔文系统12.5.0
npm错误!命令“node”“/usr/local/bin/npm”“install”“grunt contrib imagemin”“-g”
npm错误!cwd/Users/dmitrizaitsev/Dropbox/Priv/APP
npm错误!节点-v v0.10.24
npm错误!npm-V1.3.21
npm错误!path/usr/local/lib/node_modules/grunt contrib imagemin/node_modules/image min/node_modules/jpegran bin/node_modules/bin wrapper/node_modules/mout/random
npm错误!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错误!fstream_类型文件
npm错误!fstream_类文件编写器
npm错误!代码EEXIST
npm错误!呃47
npm错误!fstream_stack/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23
npm错误!fstream_stack/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm错误!fstream_stack Object.oncomplete(fs.js:107:15)
npm错误!gifsicle@0.1.4postinstall:`node lib/check.js`
npm错误!退出状态8
npm错误!
npm错误!失败gifsicle@0.1.4安装后脚本。
npm错误!这很可能是礼品包装的问题,
npm错误!与npm本身无关。
npm错误!告诉作者此操作在您的系统上失败:
npm错误!节点lib/check.js
npm错误!您可以通过以下方式获取他们的信息:
npm错误!npm所有者ls gifsicle
npm错误!上面可能还有其他日志输出。
npm错误!达尔文系统12.5.0
npm错误!命令“node”“/usr/local/bin/npm”“install”“grunt contrib imagemin”“-g”
npm错误!cwd/Users/dmitrizaitsev/Dropbox/Priv/APP
npm错误!节点-v v0.10.24
npm错误!npm-V1.3.21
npm错误!代码失效循环
npm错误!
npm错误!其他日志记录详细信息可在以下位置找到:
npm错误/Users/dmitrizaitsev/Dropbox/Priv/APP/npm-debug.log
npm错误!不正常代码0
关于这里发生的事情有什么帮助吗?npm有时会遇到问题。它可以满足很多要求。今天的例子: 无论是什么原因导致了你的问题。你最近又试过吗 编辑:修正了一个打字错误