Trouble in building ZMQ node module on Ubuntu server

1,775 views
Skip to first unread message

hd nguyen

unread,
Jul 15, 2012, 11:02:44 PM7/15/12
to nod...@googlegroups.com

Hi all,

I have some troubles when trying to execute this command: npm install zmq (on Ubuntu server) but get following error:

npm install zmq
npm http GET https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/zmq

z...@2.1.0 install /home/tiniplanet/pubsub/node_modules/zmq
node-gyp rebuild

info it worked if it ends with ok 
spawn python [ '/home/tiniplanet/.node-gyp/0.8.1/tools/gyp_addon',
'binding.gyp',
'-I/home/tiniplanet/pubsub/node_modules/zmq/build/config.gypi',
'-f',
'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /home/tiniplanet/pubsub/node_modules/zmq/build'
CXX(target) Release/obj.target/binding/binding.o
../binding.cc:29:17: fatal error: zmq.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/binding/binding.o] Error 1
make: Leaving directory
/home/tiniplanet/pubsub/node_modules/zmq/build'
ERR! Error: make failed with exit code: 2
at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:212:23)
at ChildProcess.EventEmitter.emit (events.js:91:17)
at Process._handle.onexit (child_process.js:674:10)
ERR! not ok

npm ERR! z...@2.1.0 install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR! 
npm ERR! Failed at the z...@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! 
npm ERR! System Linux 3.2.0-26-generic-pae
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "zmq"
npm ERR! cwd /home/tiniplanet/pubsub
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.24
npm ERR! code ELIFECYCLE
npm ERR! message z...@2.1.0 install: node-gyp rebuild
npm ERR! message sh "-c" "node-gyp rebuild" failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR! /home/tiniplanet/pubsub/npm-debug.log
npm not ok

I also installed node-gyp module by doing: npm install -g node-gyp successfully.

Appreciate any suggestion/help.

@I have same topic but in WINDOWS platform before, a friend here shared me zmq node module working in windows platform(it runs but I cannot build on window before), today I tried again with npm install zmq on windows and surprising it works well (can build the module, maybe zmq module author made some modifications :-?)


Thanks in advance.
--
Nguyen Hai Duy
Mobile : 0914 72 1900
Yahoo: nguyenhd_lucky

mscdex

unread,
Jul 15, 2012, 11:37:37 PM7/15/12
to nod...@googlegroups.com
On Sunday, July 15, 2012 11:02:44 PM UTC-4, hd nguyen wrote:

../binding.cc:29:17: fatal error: zmq.h: No such file or directory

Looks like you don't have libzmq and/or libzmq-dev installed. 

hd nguyen

unread,
Jul 15, 2012, 11:44:23 PM7/15/12
to nod...@googlegroups.com
Hi mscdex,

Tried to run npm install libzmq libzmq-dev but seems those modules did not exist in node module repository.

D:\NodeJS_Examples\pubsub\node_modules>npm install libzmq-dev
npm ERR! 404 'libzmq-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Rong Shen

unread,
Jul 16, 2012, 12:00:41 AM7/16/12
to nod...@googlegroups.com
libzmq is not a node module so you can not use npm to install.

You can insatll libzmq via your Package Manager or follow the build/install instructions below.

Git repos here.
https://github.com/zeromq/zeromq2-x

Notice that node ZMQ does not support libzmq 3.x but only 2.x.

在 2012年7月16日星期一UTC+8上午11时44分23秒,hd nguyen写道:
Hi mscdex,

Tried to run npm install libzmq libzmq-dev but seems those modules did not exist in node module repository.

D:\NodeJS_Examples\pubsub\node_modules>npm install libzmq-dev
npm ERR! 404 'libzmq-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.


On Mon, Jul 16, 2012 at 10:37 AM, mscdex <msc...@gmail.com> wrote:
On Sunday, July 15, 2012 11:02:44 PM UTC-4, hd nguyen wrote:

../binding.cc:29:17: fatal error: zmq.h: No such file or directory

Looks like you don't have libzmq and/or libzmq-dev installed. 

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

hd nguyen

unread,
Jul 16, 2012, 12:16:29 AM7/16/12
to nod...@googlegroups.com
Hi,

Installed libzmq-dev successfully: sudo apt-get libzmq-dev

Tried to run again: npm install zmq 

but still got the same error.

@Rong Shen: any suggestion on it? How can I check libzmq-dev version to make sure it's 2.x version?

Thanks.

For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

mscdex

unread,
Jul 16, 2012, 1:02:50 AM7/16/12
to nod...@googlegroups.com
On Monday, July 16, 2012 12:16:29 AM UTC-4, hd nguyen wrote:
Installed libzmq-dev successfully: sudo apt-get libzmq-dev

Tried to run again: npm install zmq 

but still got the same error.


hd nguyen

unread,
Jul 16, 2012, 1:08:20 AM7/16/12
to nod...@googlegroups.com
Thanks mscdex, it works now :)

But I do have a concern why I cannot install it via npm install zmq merely?

Anything I'm missing here?

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

mscdex

unread,
Jul 16, 2012, 1:58:12 AM7/16/12
to nod...@googlegroups.com
On Monday, July 16, 2012 1:08:20 AM UTC-4, hd nguyen wrote:
But I do have a concern why I cannot install it via npm install zmq merely?

Anything I'm missing here?

The problem is that the header files that were supposed to come from the libzmq-dev package are not being found by the build script. The commit I made to my fork simply uses the bundled libzmq header files.

hd nguyen

unread,
Jul 16, 2012, 2:04:01 AM7/16/12
to nod...@googlegroups.com
Do you have zmq module author know about this issue and suggest your fix? I think it helps prevent different users from posting the same question as mine in case they get stuck in it.

Thanks mscdex. 

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

mscdex

unread,
Jul 16, 2012, 2:12:04 AM7/16/12
to nod...@googlegroups.com
On Monday, July 16, 2012 2:04:01 AM UTC-4, hd nguyen wrote:
Do you have zmq module author know about this issue and suggest your fix? I think it helps prevent different users from posting the same question as mine in case they get stuck in it.

I'm not sure it's something that the module author can do much about. The compiler should automatically find the headers as long as they're placed in a sane place (e.g. /usr/include, /usr/local/include, etc).

Judging by the contents of the Ubuntu 12.04 libzmq-dev package [1], the libzmq 2.1 header files get installed to /usr/include. I'm not sure why your compiler is not finding them.

hd nguyen

unread,
Jul 16, 2012, 2:26:42 AM7/16/12
to nod...@googlegroups.com
OK got it.

Thanks a lot for your enthusiastic support :)

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
Reply all
Reply to author
Forward
0 new messages