If you haven’t followed the recent releases of node.js you could be forgiven for finding the numbering a little confusing. Hopefully this article should help clarify things and get you up and running with a version of node.js and MQ Light that works on your system.

The recent versions of node.js are as follows:

0.10 (0.10.41 being the latest stable version)
0.12 (0.12.9 latest at the time of writing)
4 (4.2.3 latest at the time of writing)
5 (5.3.0 latest at the time of writing)

The sudden jump from 0.12 to 4 is due to the fact that node.js was forked to io.js. The latest version of io.js before the two merged back together was 3.0, so the new merged node.js version is 4.

The MQ Light client for node.js is currently supported on node.js 0.10.*, 0.12.*, and 4.*. However depending on the version of Linux you are using you may not have a high enough version of glibc to run the MQ Light client with node.js 4. If you have a version of glibc lower than 2.14 you cannot run the MQ Light client with node.js 4. If you do you will see an error like this:

[samples]$ node send.js
/build/node-v4.2.2-linux-x64/bin/node_modules/mqlight/mqlight.js:67
throw _;
^

Error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /build/node-v4.2.2-linux-x64/bin/node_modules/mqlight/lib/node-v46-linux-x64/proton.node)
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/build/node-v4.2.2-linux-x64/bin/node_modules/mqlight/mqlight.js:62:18)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)

If you hit this error you have a couple of options.

1) Upgrade to a version of glibc >= 2.14
2) Run with node.js 0.12

Older versions of node.js for all platforms are available to download from nodejs.org. If you can’t upgrade to a higher version of glibc then installing and running node.js 0.12.9 will work fine.

If you have already installed the node.js 4 version of the MQ Light module and then decide to switch to node.js 0.12 you will need to run “npm uninstall mqlight” to remove the node.js 4 module, followed by “npm install mqlight” to install 0.12 version.

Join The Discussion

Your email address will not be published.