简体   繁体   中英

Error on npm install

I'm trying to install npm packages via terminal and getting the folowing errors. Tried all solutions at npm github, but none of them are working.

Removed node_modules and ran

npm install

again, but still the errors are there.

npm ERR! Error: ENOENT, open
    '/var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md'
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 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! EEXIST, mkdir '/var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js'
File exists: /var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js
Move it away, and try again.

npm ERR! System Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js
npm ERR! fstream_path /var/www/simulator/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/.npmignore
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.2.2.tgz
npm ERR! Error: UNKNOWN, symlink '../mime/cli.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 Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! 

npm -v 1.3.10
npm ERR! path ../mime/cli.js
npm ERR! code UNKNOWN
npm ERR! errno -1

npm ERR! error rolling back Error: UNKNOWN, unlink '/var/www/simulator/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js'
npm ERR! error rolling back  request@2.69.0 { [Error: UNKNOWN, unlink '/var/www/simulator/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js']
npm ERR! error rolling back   errno: -1,
npm ERR! error rolling back   code: 'UNKNOWN',
npm ERR! error rolling back   path: '/var/www/simulator/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js' }
npm ERR! Error: ENOENT, chmod '/var/www/simulator/node_modules/request/node_modules/qs/test/parse.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 Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /var/www/simulator/node_modules/request/node_modules/qs/test/parse.js
npm ERR! fstream_path /var/www/simulator/node_modules/request/node_modules/qs/test/parse.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

npm ERR! error rolling back Error: UNKNOWN, unlink '/var/www/simulator/node_modules/jade/node_modules/uglify-js/tools/domprops.json'
npm ERR! error rolling back  jade@1.11.0 { [Error: UNKNOWN, unlink '/var/www/simulator/node_modules/jade/node_modules/uglify-js/tools/domprops.json']
npm ERR! error rolling back   errno: -1,
npm ERR! error rolling back   code: 'UNKNOWN',
npm ERR! error rolling back   path: '/var/www/simulator/node_modules/jade/node_modules/uglify-js/tools/domprops.json' }
npm ERR! Error: ENOENT, utime '/var/www/simulator/node_modules/jade/node_modules/clean-css/lib/tokenizer/extract-properties.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 Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /var/www/simulator/node_modules/jade/node_modules/clean-css/lib/tokenizer/extract-properties.js
npm ERR! fstream_path /var/www/simulator/node_modules/jade/node_modules/clean-css/lib/tokenizer/extract-properties.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call utimes
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! EEXIST, mkdir '/var/www/simulator/node_modules/jade/node_modules/jstransformer/node_modules/promise/node_modules/asap'
File exists: /var/www/simulator/node_modules/jade/node_modules/jstransformer/node_modules/promise/node_modules/asap
Move it away, and try again.

npm ERR! System Linux 3.13.0-55-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/simulator
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /var/www/simulator/node_modules/jade/node_modules/jstransformer/node_modules/promise/node_modules/asap
npm ERR! fstream_path /var/www/simulator/node_modules/jade/node_modules/jstransformer/node_modules/promise/node_modules/asap/asap.js
npm ERR! fstream_type File


npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/lib/nodejs/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/var/www/simulator/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema'
npm ERR! error rolling back  http-signature@1.1.1 { [Error: ENOTEMPTY, rmdir '/var/www/simulator/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/js
on-schema']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/var/www/simulator/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema' }

npm ERR! error rolling back Error: UNKNOWN, unlink '/var/www/simulator/node_modules/jade/node_modules/with/node_modules/acorn-globals/node_modules/acorn/dist/acorn_loose.js'
npm ERR! error rolling back  with@4.0.3 { [Error: UNKNOWN, unlink '/var/www/simulator/node_modules/jade/node_modules/with/node_modules/acorn-globals/node_modules/acorn/dist/acorn_lo
ose.js']
npm ERR! error rolling back   errno: -1,
npm ERR! error rolling back   code: 'UNKNOWN',
npm ERR! error rolling back   path: '/var/www/simulator/node_modules/jade/node_modules/with/node_modules/acorn-globals/node_modules/acorn/dist/acorn_loose.js' }

This happens because your host is windows & guest is linux. If both of them are *nix based then you will not get the issue.

There are two options to sort this out.

1. npm config set bin-links false (But this will prevent you from being able to use npm install -g to install global binaries.)

2. npm install --no-bin-links (Looks like you have figured it out for yourself. I recommend this method as well)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM