Installing MineOS-node (pkg add)

Edit: This post tries to get around npm error by using an older version of node/npm. The next post tells you how to use node v4, so do that instead. :smile:

Just a note for anyone struggling to install MineOS-node (pkg add) from the Wiki.

The wiki instructions for installing packages looks like this:

pkg install -y rdiff-backup rsync gmake screen git sysutils/py-supervisor node www/npm

On my FreeBSD Jail on FreeNAS 9.3 the installation of the packages works fine, but running “npm install” at the end fails. This is because a couple of the node.js modules require compilation and the latest package of node.js compiles them differently (see this for details).

The solution is to install the older node012 and www/npm012 packages, like so:

pkg install -y rdiff-backup rsync gmake screen git sysutils/py-supervisor node012 www/npm012

Instead of using an older version of node, you can tell gmake to use clang instead of GNU C++ to compile, which seems to work for me on all the node modules that need to be compiled for MineOS. Make sure you are using the “sh” shell in order for this to work (it should work with other shells, but some use different syntax to set environment variables).

sh
CXX=clang++ npm install

And that should work.