zeromq.node icon indicating copy to clipboard operation
zeromq.node copied to clipboard

node-gyp rebuild failed on installation

Open fabifrank opened this issue 8 years ago • 13 comments

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/debby/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Linux 3.16.0-4-amd64 gyp ERR! command "/home/debby/.nvm/versions/node/v6.6.0/bin/node" "/home/debby/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/debby/Documents/dev/bot/app/bot/src/node_modules/zmq gyp ERR! node -v v6.6.0 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm ERR! Linux 3.16.0-4-amd64 npm ERR! argv "/home/debby/.nvm/versions/node/v6.6.0/bin/node" "/home/debby/.nvm/versions/node/v6.6.0/bin/npm" "install" "zmq" "--save" npm ERR! node v6.6.0 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, 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

fabifrank avatar Oct 01 '16 16:10 fabifrank

I have had the same problem. What I found http://stackoverflow.com/questions/21365714/nodejs-error-installing-with-npm It says you may not need VS, but need Python. I don't want any of those for my app.

Alex2357 avatar Oct 27 '16 00:10 Alex2357

If you want zeromq yet don't want to have to bother with building with node-gyp, use zeromq.

rgbkrk avatar Oct 27 '16 00:10 rgbkrk

I wanted just a single nodejs package which can do a job. Your prebuilt package still has too many dependencies

Alex2357 avatar Oct 27 '16 01:10 Alex2357

Ok, good luck!

rgbkrk avatar Oct 27 '16 01:10 rgbkrk

Same error for

$ npm install zmq

versions:

node v7.0.0 npm v3.10.8 zmq: 2.15.3 python 2.7.10 gnu make: 3.81 gcc: clang: 8.0.0

system: Darwin 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64


/bin/sh: pkg-config: command not found gyp: Call to 'pkg-config libzmq --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/opt/node-v7.0.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Darwin 16.1.0 gyp ERR! command "/opt/node-v7.0.0-darwin-x64/bin/node" "/opt/node-v7.0.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /not-shown/node_modules/zmq gyp ERR! node -v v7.0.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok

npm ERR! Darwin 16.1.0 npm ERR! argv "/opt/node-v7.0.0-darwin-x64/bin/node" "/opt/node/bin/npm" "install" "zmq" npm ERR! node v7.0.0 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild

npm ERR! Exit status 1

427 error Darwin 16.1.0 652 428 error argv "/opt/node-v7.0.0-darwin-x64/bin/node" "/opt/node/bin/npm" "install" "zmq" 653 429 error node v7.0.0 654 430 error npm v3.10.8 655 431 error code ELIFECYCLE 656 432 error [email protected] install: node-gyp rebuild 657 432 error Exit status 1

658 433 error Failed at the [email protected] install script 'node-gyp rebuild'.

cibercitizen1 avatar Oct 27 '16 20:10 cibercitizen1

Same error here on CentOS 6:

gyp ERR! System Linux 2.6.32-642.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-projects/test/node_modules/zmq
gyp ERR! node -v v7.3.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 2.6.32-642.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "zmq"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!

I also tried using zmq-prebuilt which resulted in errors:

prebuild ERR! build error
prebuild ERR! stack Error: `make` failed with exit code: 2
prebuild ERR! stack     at ChildProcess.onExit (/root/node-projects/test/node_modules/node-gyp/lib/build.js:276:23)
prebuild ERR! stack     at emitTwo (events.js:106:13)
prebuild ERR! stack     at ChildProcess.emit (events.js:191:7)
prebuild ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
prebuild ERR! not ok
prebuild ERR! build Error: `make` failed with exit code: 2
prebuild ERR! build     at ChildProcess.onExit (/root/node-projects/test/node_modules/node-gyp/lib/build.js:276:23)
prebuild ERR! build     at emitTwo (events.js:106:13)
prebuild ERR! build     at ChildProcess.emit (events.js:191:7)
prebuild ERR! build     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[email protected] /root/node-projects/test
└── [email protected]  extraneous

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 2.6.32-642.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "zmq-prebuilt"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `prebuild --install`
npm ERR! Exit status 2
npm ERR!

It would appear that ZMQ does not work with newer versions of NodeJS, or that it does not work well on Linux-based machines, due to the many dependencies required.

Is there a specific version of NodeJS that is recommended?

evanbechtol avatar Dec 28 '16 16:12 evanbechtol

We ended up deprecating / changing the name of zmq-prebuilt to zeromq. We're on release 4.1.0 so I'd try again - it looks like you've installed 2.1.0 of zmq-prebuilt.

rgbkrk avatar Dec 28 '16 17:12 rgbkrk

@rgbkrk I had tried both commands, and both failed with the same error message. The module was not installed.

using the command npm install --save zeromq on my CentOS 6 system:

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 2.6.32-642.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-projects/test/node_modules/zeromq
gyp ERR! node -v v7.3.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 2.6.32-642.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "zeromq"
npm ERR! node v7.3.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `prebuild-install || (npm run build:libzmq && node-gyp rebuild)`
npm ERR! Exit status 1
npm ERR!

evanbechtol avatar Dec 28 '16 17:12 evanbechtol

/cc @lgeiger

rgbkrk avatar Dec 28 '16 17:12 rgbkrk

It looks like the prebuilds didn't install for you and it's going back to a source based installation. Sadly the traceback doesn't say much about what the missing pieces might be. We have a guide for building from source which would be good to cross reference to see if you have all the dependencies.

To get a better, non-hidden traceback you can run these directly

npm run build:libzmq
$(npm bin)/node-gyp rebuild

rgbkrk avatar Dec 28 '16 17:12 rgbkrk

@rgbkrk @lgeiger

I have found the problem! It's not mentioned in the installation documentation, which may need to be updated to help future users.

The problem was that the zeromq installation requires a c++11 compiler. If you are using a compiler below version 4.8.x, then the install will fail. Since CentOS comes by default with version 4.4, if it is not upgraded, the zeromq install fails.

The error results from an error involving an unexpected '<' somewhere in the build. However, with a c++11 compiler, it builds successfully. Instructions on upgrading your gcc version can be found here:

https://edwards.sdsu.edu/research/c11-on-centos-6/

Once I did this, the setup ran perfectly using the command npm install --save zeromq

evanbechtol avatar Dec 28 '16 17:12 evanbechtol

I'm glad you got it working! @Parasin A PR adding a note to the installation instructions on zeromq would be super helpful :)

lgeiger avatar Dec 29 '16 09:12 lgeiger

@Parasin that worked perfectly as well. finally after a year or something of dealing with this problem heh... not the most ideal fix but at least there is a fix.

ziazon avatar Jan 06 '17 18:01 ziazon