NPM安装错误 - “奇怪的错误8”,“扔呃;”

时间:2014-03-18 10:39:30

标签: node.js npm grunt-contrib-imagemin

当我尝试安装grunt-contrib-imagemin@0.4.1时,我收到了这些错误(在终端中);

> optipng-bin@0.3.1 postinstall /Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin
> node lib/check.js


events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: tunneling socket could not be established, cause=connect EHOSTUNREACH
    at ClientRequest.onError (/Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js:159:17)
    at ClientRequest.g (events.js:175:14)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1528:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at Socket.onerror (tls.js:1424:17)
    at Socket.EventEmitter.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
unbuild optipng-bin@0.3.1

> gifsicle@0.1.4 postinstall /Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/gifsicle
> node lib/check.js


events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: tunneling socket could not be established, cause=connect EHOSTUNREACH
    at ClientRequest.onError (/Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js:159:17)
    at ClientRequest.g (events.js:175:14)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1528:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at Socket.onerror (tls.js:1424:17)
    at Socket.EventEmitter.emit (events.js:117:20)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
unbuild gifsicle@0.1.4
unbuild grunt-contrib-imagemin@0.4.1
npm ERR! Error: ENOENT, open '/Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js'
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 Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/bin/npm" "install" "grunt-contrib-imagemin@0.4.1" "--save-dev"
npm ERR! cwd /Users/<omitted>/Workspace/<omitted>/server/public/angular
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! path /Users/<omitted>/Workspace/<omitted>/server/public/angular/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! weird error 8

npm-debug.log文件看起来像这样;

16117 error Error: ENOENT, utime '/var/folders/1m/0y7hjtm94rdcpk3frnf43d2c0000gx/T/npm-69757/1395137735074-0.018615296110510826/package/README.md'
16118 error If you need help, you may report this log at:
16118 error     <http://github.com/isaacs/npm/issues>
16118 error or email it to:
16118 error     <npm-@googlegroups.com>
16119 error System Darwin 13.1.0
16120 error command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/bin/npm" "install" "grunt-contrib-imagemin@0.4.1" "--save-dev"
16121 error cwd /Users/<omitted>/Workspace/<omitted>/server/public/angular
16122 error node -v v0.10.13
16123 error npm -v 1.3.2
16124 error path /var/folders/1m/0y7hjtm94rdcpk3frnf43d2c0000gx/T/npm-69757/1395137735074-0.018615296110510826/package/README.md
16125 error fstream_path /var/folders/1m/0y7hjtm94rdcpk3frnf43d2c0000gx/T/npm-69757/1395137735074-0.018615296110510826/package/README.md
16126 error fstream_type File
16127 error fstream_class FileWriter
16128 error fstream_finish_call utimes
16129 error code ENOENT
16130 error errno 34
16131 error fstream_stack /usr/local/Cellar/node/0.10.13/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
16131 error fstream_stack Object.oncomplete (fs.js:107:15)
16132 verbose exit [ 34, true ]

出了什么问题?奇怪的是,我今天早些时候安装了grunt-contrib-imagemin但是已经卸载它以获得0.4.1而不是0.5.0。现在我根本无法重新安装任何版本。

我做了

rm -rd node_modules/
npm install

只是为了清理node_modules文件夹。仍然没有工作。

1 个答案:

答案 0 :(得分:0)

公司代理设置错误(http_proxyhttps_proxy env变量)