how to install zeromq for node.js
Asked Answered
B

5

5

I want to install zeromq for node.js in Windows 7 64-bit. I tried with

npm install zmq

It gave phython.exe is missing. After installing that python (2.7.3).
Again it gave some build error, which is as follows:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1

Botanomancy answered 25/12, 2012 at 9:11 Comment(1)
do you want to install on a 32bit or 64bit windows?Anabatic
A
7

Update 1

Improvements were made, now npm install zmq works, but you still need Win SDK 7 and VS C++ 2010, I think.

Original Answer

Unfortunately npm install zmq still don't work, but you can install it from local repo.

mscdex forked the zeromq.node repo, and added windows support, so just clone his zeromq.node

But before build you need some prerequisites:

Run the Windows SDK 7.1 Command Prompt from Start menu / Microsoft Windows SDK v7.1

go to the cloned directory, and type

node-gyp configure
node-gyp build

this should work on windows 7 64bit. I cloned zeromq.node into my node project dir, so in my app.js i could require('./zeromq.node').

Anabatic answered 26/12, 2012 at 19:33 Comment(3)
Thanks for the help. Wow that was a lot of work! Getting the Windows 7 SDK installed involved uninstalling the newest C++ compiler (I think 10.4.xxx is incompatible). Source: "Had a similar problem which turned out to be that the SDK 7.1 does NOT install if you have a newer vcredist_x86.exe than version 10.0.30319 of Visual C++ 2010 x86 Redistributable... I had 10.0.30419 installed... removed it through control panel "remove programs" and then the SDK 7.1 installed."Clubwoman
@Clubwoman My answer is mainly for win7 64bit, so I installed vcredist_x64.exe not vcredist_x86.exe. For installing it on a 32bit windows I used the work of MatthiasgAnabatic
No longer work with newer nodejs and vs2012 but vs2015 also have yet another error pfnDliNotifyHook2. Fixed this with npm -g install npm@next with vs2015. Refer to here and hereExistent
M
4

I had alot of trouble myself and eventually got it installed after hours of reading and trying diff things out:

  1. Install python. Make sure Python 2.7.x installed and not 3.x (i used https://www.python.org but cygwin's python might work too) Confirm by running below:

    $ python -V Python 2.7.9

  2. set PYTHON env variable, whereever you installed it (or cygwin's bin directory if installing python that way):

    PYTHON=C:\dev\python\python.exe

  3. Set what folder python.exe added onto your PATH variable:

    PATH=C:\dev\python\;

  4. needed this node-gyp installed manually:

    $ npm install -g node-gyp ... Got slightly further...

  5. So I quit with trying to get it to install with my current Visual C++ 2010 and got Visual C++ 2012 to work (think 2013 may work too): so installed 'Visual Studio 2012 Express for Windows Desktop'
    Should install the '2012 Visual C++ Redistributables' (if not, install separately).

    Also had 'Windows7 SDK' already installed per balazs instructions so probably need that too.

    Now try on Windows command line and specify the version to use:

    $ npm install --msvs_version=2012 zmq and it worked!

    Note: wanted to mention what I already had installed. Already had 'Visual Studio C++ 2010 Express' installed (which installed Visual C++ 2010 Redistributables) and Windows7 SDK since I was kinda following balazs instructions above.

    Then I tried installing: 'Microsoft Visual Studio 2010 Service Pack 1' 'Visual C++ SP1 Compiler Update for Windows SDK 7.1'

    Since none of that 2010 worked, I went with 2012. Maybe someone can figure out if possible to make it work with C++ 2010.

Markitamarkka answered 5/1, 2015 at 8:57 Comment(0)
K
1

I did not look into recent changes in that package but I wrote https://github.com/matthiasg/zeromq-node-windows for our own projects which added minor changes to the zeromq-node project to make it work in Windows... as it says in the readme I don't offer support , but maybe that will get you started ?

Kleptomania answered 26/12, 2012 at 9:43 Comment(0)
P
1

This thread was very useful, here's what worked for me today on Win10:

  1. Download / install zmq binaries for windows
  2. Download / install node.js for windows
  3. Get miniconda2 or similar in case you have python3 (python 2 required for the steps below build)
  4. Get VS 2013 (any version should do) VS '15 doesn't work at this time
  5. From a python2 prompt: npm install --msvs_version=2013 zmq
Pontificals answered 1/5, 2016 at 2:2 Comment(1)
I can't compile with vs2012 but managed to fix with vs2015. see my answer.Existent
E
1

The latest update:

Windows 8.1, node v4.4.5, npm v3.10.5

  1. Ensure python2 environment as usual
  2. Install Windows SDK (mine 8.1)
  3. Install VS2015 Community and select Common Tools for Visual C++
  4. ===> npm -g install npm@next see this
  5. npm install --msvs_version=2015 zmq

Note: I can't build with vs2012 anymore and all the suggested above not working with build error error c2240 cannot convert from 'v8::Value *' to 'v8:object *volatile'. Maybe because of the newer nodejs v4.4.5 (someone can clarify this?).

However using vs2015 produce build error win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2'. I fix this using npm@next as mentioned above.

Existent answered 28/7, 2016 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.