繁体   English   中英

在npm install socket.io期间,我收到错误127,找不到node-waf命令。怎么解决?

[英]During npm install socket.io I get error 127, node-waf command not found. How to solve it?

我正在尝试使用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”,我该如何解决这个问题?

谢谢!

它与socket上的问题773相关.git https://github.com/LearnBoost/socket.io/issues/773

“node-waf是Node.js附带的一个工具,用于帮助将C ++文件构建到node.js兼容的库或工具中。只有从源代码安装了node.js才能使用它。” http://apphacker.wordpress.com/ 2011/09/12 /节点WAF-命令未找到/

所以运行这个以获取缺少的依赖项为我工作sudo apt-get install nodejs-dev

值得注意的是,自0.9.1以来,node-waf已在任何版本的节点中被删除:

https://github.com/joyent/node/blob/master/ChangeLog#L630

确保node-waf不在您的路径中。

$ which node-waf

我的是/ usr / local / bin / node-waf,所以如果这不起作用的话

$ ls / usr / local / bin / node-waf

如果仍然找不到它,它位于节点内的tools目录中。 您可能需要重新安装。

如果您仍然需要socket.io的旧版本(如0.9.0),请考虑安装0.9.2版本。

  npm install socket.io@0.9.2 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM