简体   繁体   English

npm更新package.json引发错误

[英]npm update a package.json throw an error

I've installed last version of node v0.10.35 under Windows 7. This version includes npm. 我已经在Windows 7下安装了节点v0.10.35的最新版本。该版本包括npm。

When I tried to update a package.json I received the following error: 当我尝试更新package.json时,收到以下错误:

ws@0.4.31 install C:\\Users\\Giuliano\\Downloads\\Rich-Client-Music-Player-master (node-gyp rebuild 2> builderror.log) || ws@0.4.31安装C:\\ Users \\ Giuliano \\ Downloads \\ Rich-Client-Music-Player-master(node-gyp重建2> builderror.log)|| (exit 0) (0号出口)

npm ERR! ws@0.4.31 install: `(node-gyp rebuild 2> builderror.log) || (exit 0)`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the ws@0.4.31 install script.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! You can get their info via:
npm ERR!     npm owner ls ws
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\NodeJS\\\\node.exe" "C:\\Program Files\\No
npm ERR! cwd C:\Users\Giuliano\Downloads\Rich-Client-Music-Player-master
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0

I must to admit that I've installed Microsoft Visual Studio 2013 and Python 2.7.9 as a recommendation for this problem. 我必须承认我已安装Microsoft Visual Studio 2013和Python 2.7.9作为此问题的建议。 Also, if I try to install socket.io (npm install socket.io) I get the same error. 另外,如果我尝试安装socket.io(npm install socket.io),则会收到相同的错误。 I have attached a npm-debug.log 我已经附上了npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\NodeJS\\\\node.exe',
1 verbose cli   'C:\\Program Files\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'socket.io' ]
2 info using npm@1.4.28
3 info using node@v0.10.35
4 verbose node symlink C:\Program Files\NodeJS\\node.exe
5 error Error: ENOENT, stat 'C:\Users\Giuliano\AppData\Roaming\npm'
6 error If you need help, you may report this *entire* log,
6 error including the npm and node versions, at:
6 error     <http://github.com/npm/npm/issues>
7 error System Windows_NT 6.1.7601
8 error command "C:\\Program Files\\NodeJS\\\\node.exe" "C:\\Program Files\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
9 error cwd C:\Users\Giuliano\Desktop
10 error node -v v0.10.35
11 error npm -v 1.4.28
12 error path C:\Users\Giuliano\AppData\Roaming\npm
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]

我不在Windows计算机上,但是您可以在此处尝试一些解决方案例如运行:

$ npm cache clean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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