运行" npm install socket.io时出现此错误消息。"有人能帮忙吗?是" ws@0.5.0脚本的主要问题,"那是什么?
此外," node-gyp重建2>是什么? builderror.log"意思?我认为Python可能与这个问题有关,但我真的不知道如何。
非常感谢你的帮助!
$ npm install --save socket.io
npm WARN package.json famedu@1.0.0 No description
npm WARN package.json famedu@1.0.0 No repository field.
npm WARN package.json famedu@1.0.0 No README data
|
> ws@0.5.0 install
c:\codeprojects\famedu\node_modules\socket.io\node_modules\en
gine.io\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
/
> ws@0.4.31 install
c:\codeprojects\famedu\node_modules\socket.io\node_modules\s
ocket.io-client\node_modules\engine.io-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! ws@0.5.0 install: `(node-gyp rebuild 2> builderror.log) || (exit
0)`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the ws@0.5.0 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\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "socket.io"
npm ERR! cwd c:\codeprojects\famedu
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
答案 0 :(得分:1)
您需要安装python 2.x和Visual Studio(Express Edition或更高版本)才能在Windows上构建本机依赖项。
ws
是网络套接字的简称;它是一个套接字客户端 - 请参阅https://www.npmjs.com/package/ws - 并且需要将ws编译为二进制加载项。
自从1.4.28以来,npm已经有很多改进 - 特别是在安装期间的冲突和竞争条件方面。你能尝试更新你的npm安装吗?
要在Windows上更新npm,请按照此处的说明操作:https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows