zeromq.node icon indicating copy to clipboard operation
zeromq.node copied to clipboard

Half the issues here are installation fails. We need better documentation.

Open ronkorving opened this issue 11 years ago • 21 comments

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.

ronkorving avatar Oct 14 '14 23:10 ronkorving

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 avatar Oct 28 '14 00:10 ronkorving

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

skibz avatar Dec 09 '14 09:12 skibz

Help is always much appreciated :)

ronkorving avatar Jan 22 '15 02:01 ronkorving

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?

barrettr5 avatar Feb 10 '15 21:02 barrettr5

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?

reqshark avatar Feb 10 '15 21:02 reqshark

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.

barrettr5 avatar Feb 11 '15 14:02 barrettr5

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.

barrettr5 avatar Feb 18 '15 21:02 barrettr5

https://github.com/JustinTulloss/zeromq.node/blob/master/lib/index.js#L574-579

kkoopa avatar Feb 18 '15 21:02 kkoopa

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.

barrettr5 avatar Feb 19 '15 16:02 barrettr5

the key to node-gyp is python.

i recommend you use the anaconda python installer, and probably install cmake for good measure

reqshark avatar Feb 19 '15 16:02 reqshark

Any update on the addon ? DevOps around the world would be reallly grateful.

fed135 avatar Aug 14 '15 01:08 fed135

resolved, check the readme

@ronkorving can we close this

reqshark avatar Aug 14 '15 16:08 reqshark

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 ?

fed135 avatar Aug 14 '15 18:08 fed135

depends on the OS, we do that already for windows but not for unix

reqshark avatar Aug 14 '15 23:08 reqshark

Yeah, the conversation was to add it one way or another to *nix.

ronkorving avatar Aug 15 '15 01:08 ronkorving

I thought we decided we weren't doing that.. Is that something people want?

reqshark avatar Aug 15 '15 04:08 reqshark

Not sure, it's been a while. Sorry :)

ronkorving avatar Aug 15 '15 07:08 ronkorving

Bundling dependencies is generally not desirable. On Windows, however, it is more of a necessity.

kkoopa avatar Aug 15 '15 09:08 kkoopa

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 avatar Aug 15 '15 19:08 fed135

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.

barrettr5 avatar Aug 17 '15 13:08 barrettr5

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). image

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

jcrben avatar Jun 20 '16 23:06 jcrben