Half the issues here are installation fails. We need better documentation.
Either:
- [ ] people can't find what they need, but we do offer
- [ ] we don't have the information people need
- [ ] our documentation is outdated
Either way, this needs to be resolved, as it's wasted a lot of peoples' time.
I hope this is slightly resolved now, but I doubt we'll stop seeing tons of issues coming in. Leaving this open for now.
@ronkorving i might be able to help improve the docs a little. i've been using this module a bit over the past month or so. it should be kind of straight forward. i think it's just a case of looking over the examples and documenting anything undocumented, and anything that could be considered out of the ordinary.
Help is always much appreciated :)
I have been very impressed by the promise of ZeroMq. However, to make it work for our situation, we have to have a reliable binding for node.js. I have constructed a C++ prototype for that side of our communications. Now, I have tried for several days to create a binding for node without success. All of our C++ development is on Visual C++ 2012, for x64 on node v0.10.21. I am building on a Windows 2008 R2 server. The npm install had no chance of success. I then tried to build the binding.cc from scratch. I have collected and installed all the libraries and headers that I thought would be needed. I was able to get it to compile and link to a .node module. However, the module was somehow incomplete because it does not have a “socket” method. By the way, I have successfully built a few node addons in the past. Any suggestions?
if you got node v0.10 and ømq working on windows, next question:
can you npm install -g node-gyp or even just npm install node-gyp?
Bent,
Thank you for responding. Yes, I have installed node-gyp and made sure that it is the latest update. I have built other node addons with these files. I have also installed the pre-built Windows version of ZeroMQ which includes the headers and libraries for VC++ 2012. The ZeroMQ version is 4.0.4.
However, when I try to use node-gyp directly there are problems with the VC++ version and the SDK version and I don’t think it is picking up x64 instead of win32. Unfortunately, I am not very familiar with node-gyp configuration. I am using the header files and node.lib from the node-gyp installation.
When compiling and linking the binding.cc file in a VC++ project, I have had to make very few changes, mostly to remove warning about int64 mismatches. Since this my first encounter with NAN, the NAN constructs tends to obfuscate the flow of the code.
The error I get is:
var sock = zmq.socket(‘req’); ^ TypeError: Object #<Object> has no method ‘socket’ (the rest of the stack …)
From: Bent Cardan [mailto:[email protected]] Sent: Tuesday, February 10, 2015 4:57 PM To: JustinTulloss/zeromq.node Cc: Robert Barrett Subject: Re: [zeromq.node] Half the issues here are installation fails. We need better documentation. (#360)
if you got node v0.10 and ømq working on windows, next question:
can you npm install -g node-gyp or even just npm install node-gyp?
— Reply to this email directly or view it on GitHubhttps://github.com/JustinTulloss/zeromq.node/issues/360#issuecomment-73792666.
I have been analyzing the code, but I cannot see where the 'socket' function is declared or defined. I must be missing some piece of the code. I have uploaded my code to my public repro zeromq-node.
https://github.com/JustinTulloss/zeromq.node/blob/master/lib/index.js#L574-579
kkoopa; Thank you for the inspiration. I had already tried to run index.js several times without success. It could not find 'bindings' and zmq.node was in the wrong place. After your message, I did a search of my computer disks looking for 'bindings' and finally found it under the Windows 7.1 SDK directory. Evidently running npm in early Feb. had downloaded the code before crashing. I moved the entire node_modules out to be more accessible. Using what I had already learned, I was now able to run node-gyp successfully with only a few compiler warnings. I can now run index.js and my simple test js file. Finally, I can move on to actual development for our application. One key that I eventually stumbled on was the need to use the GYP_MSVS_VERSION=2012 environment variable. That was necessary to make node-gyp work, but it did not help npm.
the key to node-gyp is python.
i recommend you use the anaconda python installer, and probably install cmake for good measure
Any update on the addon ? DevOps around the world would be reallly grateful.
resolved, check the readme
@ronkorving can we close this
You do have to install the ZMQ binaries separately.
From README:
First install pkg-config and the ZeroMQ library.
What I understood from @barrettr5 's messages is that he was working on an addon to remove the need to install the binaries separately. Did I get this right ?
depends on the OS, we do that already for windows but not for unix
Yeah, the conversation was to add it one way or another to *nix.
I thought we decided we weren't doing that.. Is that something people want?
Not sure, it's been a while. Sorry :)
Bundling dependencies is generally not desirable. On Windows, however, it is more of a necessity.
Not having a clean, bundled install for linux (centOS, ubuntu) is one of the main reason why we are not using ZMQ in production. I would be glad to contribute anywhere I can to make that change.
fed135 I wish I could report better progress, but shortly after after making the breakthrough reported here, "wiser" people decided I had more important things to do. One of the problems is that we already have something that works, so there is little incentive to make it "better", at least til it breaks.
In my case, the issue was that the zmq.node file was not being built in my docker container. The fix was to run it with --unsafe-perm (see this).

In the scrollback it is easy to miss the cannot run in wd message.
