Skip to content

Instantly share code, notes, and snippets.

@tralamazza
Created July 24, 2011 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tralamazza/1102772 to your computer and use it in GitHub Desktop.
Save tralamazza/1102772 to your computer and use it in GitHub Desktop.
socketstream 0.1.8 npm install -g error
$ npm install socketstream -g
/usr/local/bin/socketstream -> /usr/local/lib/node_modules/socketstream/bin/socketstream
> zeromq@0.5.1 preinstall /usr/local/lib/node_modules/socketstream/node_modules/zeromq
> node-waf clean || true; node-waf configure build
Nothing to clean (project not configured)
Setting srcdir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq
Setting blddir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for libzmq : not found
'configure' finished successfully (0.051s)
Waf: Entering directory `/usr/local/lib/node_modules/socketstream/node_modules/zeromq/build'
[1/2] cxx: binding.cc -> build/default/binding_1.o
../binding.cc:27:17: fatal error: zmq.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/usr/local/lib/node_modules/socketstream/node_modules/zeromq/build'
Build failed: -> task failed (err #1):
{task: cxx binding.cc -> binding_1.o}
npm ERR! error installing socketstream@0.1.8 Error: zeromq@0.5.1 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing socketstream@0.1.8 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing socketstream@0.1.8 at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! zeromq@0.5.1 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the zeromq@0.5.1 preinstall script.
npm ERR! This is most likely a problem with the zeromq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls zeromq
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-10-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "socketstream" "-g"
npm ERR! cwd /home/daniel
npm ERR! node -v v0.4.10
npm ERR! npm -v 1.0.20
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/daniel/npm-debug.log
npm not ok
@tralamazza
Copy link
Author

After sudo apt-get install libzmq-dev

$ npm install socketstream -g
/usr/local/bin/socketstream -> /usr/local/lib/node_modules/socketstream/bin/socketstream

zeromq@0.5.1 preinstall /usr/local/lib/node_modules/socketstream/node_modules/zeromq
node-waf clean || true; node-waf configure build

Nothing to clean (project not configured)
Setting srcdir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq
Setting blddir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for libzmq : not found
'configure' finished successfully (0.031s)
Waf: Entering directory /usr/local/lib/node_modules/socketstream/node_modules/zeromq/build' [1/2] cxx: binding.cc -> build/default/binding_1.o ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::GetSockOpt(const v8::Arguments&)’: ../binding.cc:343:10: error: ‘ZMQ_EVENTS’ was not declared in this scope ../binding.cc:345:10: error: ‘ZMQ_FD’ was not declared in this scope ../binding.cc:346:10: error: ‘ZMQ_TYPE’ was not declared in this scope ../binding.cc:347:10: error: ‘ZMQ_LINGER’ was not declared in this scope ../binding.cc:348:10: error: ‘ZMQ_RECONNECT_IVL’ was not declared in this scope ../binding.cc:349:10: error: ‘ZMQ_BACKLOG’ was not declared in this scope ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::SetSockOpt(const v8::Arguments&)’: ../binding.cc:387:10: error: ‘ZMQ_LINGER’ was not declared in this scope ../binding.cc:388:10: error: ‘ZMQ_RECONNECT_IVL’ was not declared in this scope ../binding.cc:389:10: error: ‘ZMQ_BACKLOG’ was not declared in this scope ../binding.cc:392:10: error: ‘ZMQ_EVENTS’ was not declared in this scope ../binding.cc:393:10: error: ‘ZMQ_FD’ was not declared in this scope ../binding.cc:394:10: error: ‘ZMQ_TYPE’ was not declared in this scope ../binding.cc: In function ‘void zmq::Initialize(v8::Handle<v8::Object>)’: ../binding.cc:780:5: error: ‘ZMQ_FD’ was not declared in this scope ../binding.cc:781:5: error: ‘ZMQ_EVENTS’ was not declared in this scope ../binding.cc:782:5: error: ‘ZMQ_TYPE’ was not declared in this scope ../binding.cc:783:5: error: ‘ZMQ_LINGER’ was not declared in this scope ../binding.cc:784:5: error: ‘ZMQ_RECONNECT_IVL’ was not declared in this scope ../binding.cc:785:5: error: ‘ZMQ_BACKLOG’ was not declared in this scope Waf: Leaving directory/usr/local/lib/node_modules/socketstream/node_modules/zeromq/build'
Build failed: -> task failed (err #1):
{task: cxx binding.cc -> binding_1.o}
npm ERR! error installing socketstream@0.1.8 Error: zeromq@0.5.1 preinstall: node-waf clean || true; node-waf configure build
npm ERR! error installing socketstream@0.1.8 sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR! error installing socketstream@0.1.8 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! zeromq@0.5.1 preinstall: node-waf clean || true; node-waf configure build
npm ERR! sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the zeromq@0.5.1 preinstall script.
npm ERR! This is most likely a problem with the zeromq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls zeromq
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-10-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "socketstream" "-g"
npm ERR! cwd /home/daniel
npm ERR! node -v v0.4.10
npm ERR! npm -v 1.0.20
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/daniel/npm-debug.log
npm not ok

@tralamazza
Copy link
Author

Apparently Ubuntu (11.04) installs an older version of libzmq (2.0.10) and node-zmq require version > 2.1.0.
After manually installing the latest libzmq version git clone git://github.com/zeromq/libzmq.git:

$ npm install socketstream -g
/usr/local/bin/socketstream -> /usr/local/lib/node_modules/socketstream/bin/socketstream

zeromq@0.5.1 preinstall /usr/local/lib/node_modules/socketstream/node_modules/zeromq
node-waf clean || true; node-waf configure build

Nothing to clean (project not configured)
Setting srcdir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq
Setting blddir to : /usr/local/lib/node_modules/socketstream/node_modules/zeromq/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for libzmq : yes
'configure' finished successfully (0.030s)
Waf: Entering directory /usr/local/lib/node_modules/socketstream/node_modules/zeromq/build' [1/2] cxx: binding.cc -> build/default/binding_1.o ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::GetSockOpt(const v8::Arguments&)’: ../binding.cc:330:10: error: ‘ZMQ_HWM’ was not declared in this scope ../binding.cc:336:10: error: ‘ZMQ_SWAP’ was not declared in this scope ../binding.cc:339:10: error: ‘ZMQ_MCAST_LOOP’ was not declared in this scope ../binding.cc:341:10: error: ‘ZMQ_IDENTITY’ was not declared in this scope ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::SetSockOpt(const v8::Arguments&)’: ../binding.cc:373:10: error: ‘ZMQ_HWM’ was not declared in this scope ../binding.cc:378:10: error: ‘ZMQ_SWAP’ was not declared in this scope ../binding.cc:381:10: error: ‘ZMQ_MCAST_LOOP’ was not declared in this scope ../binding.cc:383:10: error: ‘ZMQ_IDENTITY’ was not declared in this scope ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::Recv(const v8::Arguments&)’: ../binding.cc:599:45: error: too few arguments to function ‘int zmq_recv(void*, void*, size_t, int)’ /usr/local/include/zmq.h:204:16: note: declared here ../binding.cc: In static member function ‘static v8::Handle<v8::Value> zmq::Socket::Send(const v8::Arguments&)’: ../binding.cc:713:46: error: too few arguments to function ‘int zmq_send(void*, const void*, size_t, int)’ /usr/local/include/zmq.h:203:16: note: declared here ../binding.cc: In function ‘void zmq::Initialize(v8::Handle<v8::Object>)’: ../binding.cc:762:5: error: ‘ZMQ_DEALER’ was not declared in this scope ../binding.cc:768:5: error: ‘ZMQ_HWM’ was not declared in this scope ../binding.cc:769:5: error: ‘ZMQ_SWAP’ was not declared in this scope ../binding.cc:771:5: error: ‘ZMQ_IDENTITY’ was not declared in this scope ../binding.cc:776:5: error: ‘ZMQ_MCAST_LOOP’ was not declared in this scope ../binding.cc:792:5: error: ‘ZMQ_NOBLOCK’ was not declared in this scope Waf: Leaving directory/usr/local/lib/node_modules/socketstream/node_modules/zeromq/build'
Build failed: -> task failed (err #1):
{task: cxx binding.cc -> binding_1.o}
npm ERR! error installing socketstream@0.1.8 Error: zeromq@0.5.1 preinstall: node-waf clean || true; node-waf configure build
npm ERR! error installing socketstream@0.1.8 sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR! error installing socketstream@0.1.8 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing socketstream@0.1.8 at ChildProcess.onexit (child_process.js:192:12)
npm ERR! zeromq@0.5.1 preinstall: node-waf clean || true; node-waf configure build
npm ERR! sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the zeromq@0.5.1 preinstall script.
npm ERR! This is most likely a problem with the zeromq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls zeromq
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-10-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "socketstream" "-g"
npm ERR! cwd /home/daniel
npm ERR! node -v v0.4.10
npm ERR! npm -v 1.0.20
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/daniel/npm-debug.log
npm not ok

@tralamazza
Copy link
Author

I should have installed git://github.com/zeromq/zeromq2-1.git (2.1), my bad.

@tralamazza
Copy link
Author

Summary:

$ git clone git://github.com/zeromq/zeromq2-1.git
$ cd zeromq2-1
$ ./autogen.sh; ./configure; make; make install

Note: you need uuid-dev sudo apt-get install uuid-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment