Search code examples
node.jsnpmgrunt-contrib-imagemin

NPM Installation error - "weird error 8", "throw er;"


when I try to install [email protected] I get these errors (in the terminal);

> [email protected] 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 [email protected]

> [email protected] 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 [email protected]
unbuild [email protected]
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!     <[email protected]>

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/bin/npm" "install" "[email protected]" "--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

The npm-debug.log file looks like this;

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     <[email protected]>
16119 error System Darwin 13.1.0
16120 error command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/bin/npm" "install" "[email protected]" "--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 ]

What's wrong? The weird thing is that I had grunt-contrib-imagemin installed earlier today but uninstalled it in order to get 0.4.1 instead of 0.5.0. Now I can't reinstall any versions at all.

I did a

rm -rd node_modules/
npm install

just to clean the node_modules folder. Still not working.


Solution

  • Corporate proxy setting was faulty (http_proxy and https_proxy env variables)