在 npm install socket.io 期间,出现错误 127,未找到 node-waf 命令。怎么解决呢?

2024-03-09

我正在尝试使用node.js 包管理器在centos 5 上安装socket.io。 在安装过程中我遇到了一个错误:

“make:node-waf:找不到命令”
and
“这很可能是 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

> [email protected] /cdn-cgi/l/email-protection 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! [email protected] /cdn-cgi/l/email-protection preinstall: `make`
npm ERR! `sh "-c" "make"` failed with 2
npm ERR! 
npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection 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 [email protected] /cdn-cgi/l/email-protection 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”以及如何解决这个问题?

Thanks!


它与 socket.io git 上的问题 773 有关https://github.com/LearnBoost/socket.io/issues/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/ http://apphacker.wordpress.com/2011/09/12/node-waf-command-not-found/

所以运行这个来让缺少的依赖项为我工作 sudo apt-get 安装nodejs-dev

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 npm install socket.io 期间,出现错误 127,未找到 node-waf 命令。怎么解决呢? 的相关文章

随机推荐