简体   繁体   中英

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.

When I tried to update a package.json I received the following error:

ws@0.4.31 install C:\\Users\\Giuliano\\Downloads\\Rich-Client-Music-Player-master (node-gyp rebuild 2> builderror.log) || (exit 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. Also, if I try to install socket.io (npm install socket.io) I get the same error. I have attached a 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

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