Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Installation

Timur Kalandarov edited this page Oct 26, 2015 · 18 revisions

Requirements

To install the package you will need libzmq and libpgm sources. The easiest way to obtain them on debian/ubuntu systems is to use Chris Lea's PPA: https://launchpad.net/~chris-lea/+archive/zeromq

sudo add-apt-repository ppa:chris-lea/zeromq
sudo add-apt-repository ppa:chris-lea/libpgm
sudo apt-get update
sudo apt-get install libzmq3-dev # or libzmq-dev to install libzmq 2.x

To list all available versions of libzmq3-dev and libzmq-dev you can use the following command

apt-cache showpkg libzmq3-dev libzmq-dev

and install one of them using:

sudo apt-get install libzmq-dev=2.1.7-1~natty1

Also you'll probably need to install g++:

sudo apt-get install g++

Installation of the package

You need to first install the actual zeromq binaries either by using a package manager (for example on the Mac OS X):

sudo port install zeromq

Then for every node.js project you have, you need to change to that directory and run

npm install zmq

(For installation on linux without root access, see [Installation on Linux / bsd without root access] (#installation-on-linux--bsd-without-root-access) )

Note that you that you can't do a global install. In node.js, once you require something, it needs to be in that directory (AFAIK), so don't try the '-g' global flag

Installation on Windows

In order to npm install zmq on Window you will first need to setup some pre-requisites...

  1. Obviously you need node installed.
  2. Download and install Python 2.7. Make sure you don't install 3.x by mistake as it won't work.
  3. Set the PYTHON environment variable to the exact location of the python.exe you just installed. Make sure to include the python.exe part at shown here: PYTHON=C:\DEV\APPS\Python\Python2.7\python.exe
  4. Add the Python folder to your path.
  5. download and install Visual Studio Express. If you are on Windows 8 I believe '''Visual Studio Express for Windows'''. Windows 7 and below want '''Visual Studio Express for Windows Desktop''. (You may be able to get away with just Visual C++ Express instead of the whole Visual Studio package.)
  6. Now you should finally be able to install zmq.
    npm install zmq

Some additional help if you have problems might be found here:

Installation on MacOS

In case you get an error 'Error: not found: make', you need to install the Xcode tools. The latest build is 5.3, but see http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools for an overview.

In case you get the error, command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" failed as described in https://github.com/JustinTulloss/zeromq.node/issues/291

On OS X Mavericks (at least), pkg-config is not installed by default and this is not detected . You need to install it manually and it not detected by the installer, so you if you use MacPorts, type:

sudo port install pkgconfig

If you are using homebrew it is

brew install pkg-config

Installation on Linux / bsd without root access

If you don't have root access, download zeromq 3.2.4, install with configure --prefix, then export CXXFLAGS and LDFLAGS. Instructions :

# For freebsd, use fetch instead of wget
wget http://download.zeromq.org/zeromq-3.2.4.tar.gz
tar -xf zeromq-3.2.4.tar.gz
cd zeromq-3.2.4
./configure --prefix=$(readlink -f ..)
make && make install
export CXXFLAGS="-I $(readlink -f ../include)"
export LDFLAGS="-L $(readlink -f ../lib) -Wl,-rpath=$(readlink -f ../lib)"
npm install zmq