JustinTulloss / zeromq.node

Node.js bindings to the zeromq library
MIT License
1.65k stars 284 forks source link

Unable to build in OS X #282

Open vicary opened 10 years ago

vicary commented 10 years ago

I just did npm i zmq and this error is all I've got.

Looks like it has something to do with the linking to libzmq, where should I start?

> node-gyp rebuild

Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
gyp: Call to 'pkg-config libzmq --libs' returned exit status 1. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/vicary/node_modules/zmq
gyp ERR! node -v v0.10.6
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0
stumpyfr commented 10 years ago

Try to compile 0MQ before, solve the problem on my mac.

wget http://download.zeromq.org/zeromq-4.0.3.tar.gz tar zxvf zeromq-4.0.3.tar.gz && cd zeromq-4.0.3 ./configure make && make install

vicary commented 10 years ago

Do you mean I should build zmq from source in order to have libzmq?

stumpyfr commented 10 years ago

yep, just a quick fix, interesting to look why the npm install fails but if you need it immediately...it's possible from source.

jorgemsrs commented 9 years ago

One similar yet more convenient way to do it on osx is to use homebrew http://brew.sh/. It boils down to brew install zeromq

SantoDE commented 9 years ago

That's what I'm trying currently, but I still have the same issue as vicary, though I tried to install via brew.

What am I missing?

SantoDE commented 9 years ago

By the way, it doesn't make a difference if I install zmq manually or by using brew. It just won't work. I'm rather clueless :/

jorgemsrs commented 9 years ago

Hi @SantoDE. can you paste the result of

ls -pal which pkg-config

and

echo $PKG_CONFIG_PATH

thanks

rgbkrk commented 9 years ago
$ which pkg-config
/usr/local/bin/pkg-config
$ echo $PKG_CONFIG_PATH

I'm able to work with this package in standard node land, this only breaks down for me when trying to set it up with electron/atom-shell.

reqshark commented 9 years ago

just use node 0.11.13 or whatever weird ass shit they picked as the node version on atom-shell

kkoopa commented 9 years ago

I think the latest version of electron uses something like io.js 1.7 + V8 4.2, it should all work.

reqshark commented 9 years ago

Oh that's good to hear, so back when I played with it, they must have been using a strange node version and they relabeled it as node 0.13 or something so I was guessing at it as well. That's great they use iojs now and hopefully start to correctly label things