2012-03-30 221 views
5

我一直在寻找几个小时,我仍然没有回答这个问题。 我有mac os x版本10.6.8 我从nodejs.org安装了nodejs。版本是v0.6.14。 我在终端检查了npm:npm --version。 NPM版本1.1.12是后 ,我试图NPM安装socket.io,我得到这个错误...Mac无法安装npm/nodejs的socket.io?

pm http GET https://registry.npmjs.org/socket.io 
npm http 304 https://registry.npmjs.org/socket.io 
npm http GET https://registry.npmjs.org/socket.io-client/0.9.3 
npm http GET https://registry.npmjs.org/policyfile/0.0.4 
npm http GET https://registry.npmjs.org/redis/0.6.7 
npm http 304 https://registry.npmjs.org/redis/0.6.7 
npm http 304 https://registry.npmjs.org/policyfile/0.0.4 
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.3 
npm http GET https://registry.npmjs.org/uglify-js/1.2.5 
npm http GET https://registry.npmjs.org/ws 
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 304 https://registry.npmjs.org/ws 
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1 
npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2 
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5 
npm http GET https://registry.npmjs.org/zeparser/0.0.5 

> [email protected] preinstall /Users/NAME/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws 
> make 

execvp(): No such file or directory 

npm ERR! Error: ENOENT, open '/Users/NAME/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array1.js' 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 
npm ERR! 
npm ERR! System Darwin 10.8.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io" 
npm ERR! cwd /Users/NAME 
npm ERR! node -v v0.6.14 
npm ERR! npm -v 1.1.12 
npm ERR! path /Users/NAME/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array1.js 
npm ERR! code ENOENT 
npm ERR! message ENOENT, open '/Users/NAME/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array1.js' 
npm ERR! errno {} 

npm ERR! [email protected] preinstall: `make` 
npm ERR! `sh "-c" "make"` failed with 127 
npm ERR! 
npm ERR! Failed at the [email protected] preinstall 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!  make 
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 Darwin 10.8.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io" 
npm ERR! cwd /Users/NAME 
npm ERR! node -v v0.6.14 
npm ERR! npm -v 1.1.12 
npm ERR! code ELIFECYCLE 
npm ERR! message [email protected] preinstall: `make` 
npm ERR! message `sh "-c" "make"` failed with 127 
npm ERR! errno {} 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/NAME/npm-debug.log 
npm not ok 

请帮助!

+0

在Mac OSX 10.6.8上出现同样的错误.. – 2012-08-26 14:47:42

回答

0

Socket.io在安装时运行make,并且需要node-waf才能运行。您是否通过端口等软件包管理器来安装节点,或者您是否在节点网站上使用dmg install?

这个线程和你说话的所遇到的问题:

https://github.com/LearnBoost/socket.io/issues/773

+0

我从nodejs.org安装了node-v0.6.14.pkg。所以我想我安装了一个软件包管理器? 但我该如何解决这个错误?我需要nodejs-dev来获取node-waf? – Chanckjh 2012-03-30 17:57:55

0

看来,如果你安装的socket.io的早期版本也没有必要运行make脚本等。我尝试以下,并设法得到它在我的Mac OSX 10.6.8安装成功:

npm install [email protected] 

上有this google groups post进一步讨论。

1

部队使用

npm install socket.io -f 

安装貌似测试要求节点-WAF,但不是直接的库。我希望他们最终能够解决这些问题。