zeromq.node安装错误的Ubuntu 12.04:“节点GYP重建”(zeromq.node

2019-07-31 00:26发布

我试图安装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

Answer 1:

libzmq开发及其依赖取出GYP bulid错误,并试图下面steps..it为我工作

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


Answer 2:

我设法通过以下来解决这个本教程安装Python的客户端。 完成每个步骤后,我发现我是那么就能通过NPM安装node.zeromq模块:

$ npm install zmq

我猜这是由于缺少一些必要的文件。 最有可能的libzmq-dev



文章来源: zeromq.node installation error Ubuntu 12.04: ' node-gyp rebuild'