2012-05-07 98 views
0

我已经安装NodeJs并尝试安装Socket.ioWin 7上的Socket.io安装失败

Socket.io安装连续失败。我尝试了几个不同的NodeJS版本(0.6.15,0.6.16,0.6.17,0.7.8)。所有未能安装socket.io。

完整的日志可以在pastebin找到。

控制台日志:

C:\Program Files (x86)\nodejs>npm install socket.io 
npm http GET https://registry.npmjs.org/socket.io 
npm http 304 https://registry.npmjs.org/socket.io 
npm http GET https://registry.npmjs.org/policyfile/0.0.4 
npm http GET https://registry.npmjs.org/socket.io-client/0.9.6 
npm http GET https://registry.npmjs.org/redis/0.6.7 
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.6 
npm http 304 https://registry.npmjs.org/redis/0.6.7 
npm http 304 https://registry.npmjs.org/policyfile/0.0.4 
npm http GET https://registry.npmjs.org/uglify-js/1.2.5 
npm http GET https://registry.npmjs.org/xmlhttprequest/1.2.2 
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1 
npm http GET https://registry.npmjs.org/ws 
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5 
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2 
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1 
npm http 304 https://registry.npmjs.org/ws 
npm http GET https://registry.npmjs.org/zeparser/0.0.5 
npm http GET https://registry.npmjs.org/options 
npm http GET https://registry.npmjs.org/commander 
npm http 304 https://registry.npmjs.org/zeparser/0.0.5 
npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz 
npm http 304 https://registry.npmjs.org/commander 
npm http 304 https://registry.npmjs.org/options 

> [email protected] install C:\Program Files (x86)\nodejs\node_modules\socket.io\node_mo 
dules\socket.io-client\node_modules\ws 
> node install.js 

'node' is not recognized as an internal or external command, 
operable program or batch file. 
npm http 200 https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz 

npm ERR! [email protected] install: `node install.js` 
npm ERR! `cmd "/c" "node install.js"` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 install.js 
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! 
npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File 
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io" 
npm ERR! cwd C:\Program Files (x86)\nodejs 
npm ERR! node -v v0.7.8 
npm ERR! npm -v 1.1.18 
npm ERR! code ELIFECYCLE 
npm ERR! message [email protected] install: `node install.js` 
npm ERR! message `cmd "/c" "node install.js"` failed with 1 
npm ERR! errno {} 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  C:\Program Files (x86)\nodejs\npm-debug.log 
npm not ok 

有没有解决办法?我如何在Windows 7 x64上安装Socket.IO?

回答

0

Node.js上解决的问题v0.8.3

0

(对我的作品与0.6.15,Win7的X64)

我不知道你怎么安装的节点,但好像你在你的路径没有它。 尝试编辑您的PATH变量并添加C:\Program Files (x86)\nodejs\

此外,您为什么要安装在Program Files。这应该安装在你的项目文件夹中。如果你想在全球安装一个软件包,你应该使用npm -g,但是socket.io并不是全局安装的。

+0

我刚刚使用MSI安装节点。它会自动安装在“C:\ Program Files文件(x86)\ nodejs \” 我使用以下命令(在cmd中)来安装socket.io: _C:\ Program Files文件(x86)\ nodejs> npm安装套接字.io_ – MichaelS

+0

如果您只是在控制台中键入'node',它是否工作? – mihai

+0

是的。我可以执行其他nodejs代码。但不能安装socket.io – MichaelS