ZeroMQ.Node在Ubuntu 12.04安装出现错误:'node-gyp rebuild'。

6

我正在尝试使用以下命令安装 zeromq.node:

$ npm install zmq

然而,我一直收到下面的错误。希望能得到帮助。

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/npm/node_modules/node-gyp/lib/build.js:215:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:674:10)
gyp ERR! System Linux 3.2.0-29-generic
gyp ERR! command "node" "/usr/share/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/robot/code/game/node_modules/zmq
gyp ERR! node -v v0.8.6
gyp ERR! node-gyp -v v0.6.3
gyp ERR! not ok 
npm ERR! zmq@2.1.0 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the zmq@2.1.0 install script.
npm ERR! This is most likely a problem with the zmq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls zmq
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-29-generic
npm ERR! command "nodejs" "/usr/bin/npm" "install" "zmq"
npm ERR! cwd /home/robot/code/game/test/amqp
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/robot/code/game/test/amqp/npm-debug.log
npm ERR! not ok code 0

其他日志详细信息可以在以下位置找到:home/robot/code/game/test/amqp/npm-debug.log。该文件应包含完整的错误描述。请将其发布在此处。 - Vadim Baryshev
2个回答

8

我遇到了gyp构建错误,我删除了libzmq dev及其依赖项并尝试了以下步骤...这对我起作用了。

 $ sudo apt-get update
 $ sudo apt-get install build-essential
 $ sudo apt-get install libzmq-dev
 $ npm install zmq

4
我通过遵循这个安装Python客户端的教程解决了这个问题。完成每个步骤后,我发现我可以使用npm安装node.zeromq模块:
$ npm install zmq

我猜这是由于缺少一些必需的文件,很可能是 libzmq-dev


这个回答更有帮助:https://dev59.com/-WfWa4cB1Zd3GeqPf1GF#23732646。没有必要安装Python相关的东西来修复Node工具。 - jcollum

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接