我正在尝试使用node.js包管理器在centos 5上安装socket.io。 在安装过程中,我收到了一个错误:
“make:node-waf:找不到命令”
和
“这很可能是ws包的问题”
# 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/redis/0.6.7
npm http GET https://registry.npmjs.org/socket.io-client/0.9.2
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.2
npm http 304 https://registry.npmjs.org/redis/0.6.7
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/xmlhttprequest/1.2.2
npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
npm http 304 https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/zeparser/0.0.5
> ws@0.4.8 preinstall /root/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> make
**node-waf configure build
make: node-waf: Command not found
make: *** [all] Error 127**
npm ERR! ws@0.4.8 preinstall: `make`
npm ERR! `sh "-c" "make"` failed with 2
npm ERR!
npm ERR! Failed at the ws@0.4.8 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 Linux 2.6.18-194.17.4.el5
npm ERR! command "node" "/usr/bin/npm" "install" "socket.io"
npm ERR! cwd /root
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.10
npm ERR! code ELIFECYCLE
npm ERR! message ws@0.4.8 preinstall: `make`
npm ERR! message `sh "-c" "make"` failed with 2
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok
什么是“node-waf”,我该如何解决这个问题?
谢谢!
答案 0 :(得分:4)
它与socket.io git上的问题773有关 https://github.com/LearnBoost/socket.io/issues/773
“node-waf是Node.js附带的一个工具,用于帮助将C ++文件构建到node.js兼容的库或工具中。只有从源代码安装了node.js才能使用它。” http://apphacker.wordpress.com/2011/09/12/node-waf-command-not-found/
所以运行这个以获取缺少的依赖项对我有用 sudo apt-get install nodejs-dev
答案 1 :(得分:1)
确保node-waf不在您的路径中。
$ which node-waf
我在/ usr / local / bin / node-waf中,所以如果不起作用,请尝试
$ ls / usr / local / bin / node-waf
如果仍然找不到它,它位于节点内的tools目录中。您可能需要重新安装。
答案 2 :(得分:1)
值得注意的是,自0.9.1以来,node-waf已在任何版本的节点中被删除:
答案 3 :(得分:0)
如果仍然需要socket.io的旧版本(如0.9.0),请考虑安装0.9.2版本。
npm install socket.io@0.9.2