2012-03-30 245 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,但不是直接的庫。我希望他們最終能夠解決這些問題。