Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

node-gyp rebuild failed on installation #571

Open
fabifrank opened this issue Oct 1, 2016 · 13 comments
Open

node-gyp rebuild failed on installation #571

fabifrank opened this issue Oct 1, 2016 · 13 comments

Comments

@fabifrank
Copy link

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

@Alex2357
Copy link

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.

@rgbkrk
Copy link

rgbkrk commented Oct 27, 2016

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

@Alex2357
Copy link

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

@rgbkrk
Copy link

rgbkrk commented Oct 27, 2016

Ok, good luck!

@cibercitizen1
Copy link

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'.

@evanbechtol
Copy link

evanbechtol commented Dec 28, 2016

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?

@rgbkrk
Copy link

rgbkrk commented Dec 28, 2016

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.

@evanbechtol
Copy link

evanbechtol commented Dec 28, 2016

@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!

@rgbkrk
Copy link

rgbkrk commented Dec 28, 2016

/cc @lgeiger

@rgbkrk
Copy link

rgbkrk commented Dec 28, 2016

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

@evanbechtol
Copy link

evanbechtol commented Dec 28, 2016

@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

@lgeiger
Copy link
Contributor

lgeiger commented Dec 29, 2016

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

@ziazon
Copy link

ziazon commented Jan 6, 2017

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants