我正在尝试通过终端安装npm软件包并获得以下错误。在npm github上尝试了所有解决方案,但没有一个能正常工作。
删除了node_modules并运行
npm install
再次,但仍然存在错误。
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' }
答案 0 :(得分:5)
这是因为您的主机是Windows&amp;客人是linux。如果它们都是* nix,那么你就不会遇到问题。
有两种方法可以解决这个问题。
1。npm config set bin-links false
(但这会阻止您使用npm install -g来安装全局二进制文件。)
2。npm install --no-bin-links
(看起来你已经为自己想出来了。我也推荐这种方法)