How to install the spark toolchain in Ubuntu 14.04

I had a problem trying to install the spark-cli on Ubuntu Server 14.04. I’m going to give my solution just in case anyone else encounters the same problem.

Problem: node-pre-gyp uses node instead of nodejs, so the following package didn’t install

> serialport@1.4.5 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build

/usr/bin/env: node: No such file or directory
npm info serialport@1.4.5 Failed to exec install script
npm info /usr/local/lib/node_modules/spark-cli/node_modules/serialport unbuild
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

This occurred even after I had removed node

The fix is to use a symbolic link:

sudo ln -s /usr/bin/nodejs /usr/bin/node

After creating the symlink, installing the spark-cli succeeded.

1 Like