Installation of Node.js
Like I installed the light version of Raspbian without any additional packages, it is necessary to install Node.js on which cncjs is based.
Raspberry Pi Zero is based on an armv6l architecture, so we have to download the appropriate version. Furthermore, cncjs v1.x recommends to use a specific Node.js version as v4 or v7.
cd ~ wget wget https://nodejs.org/dist/v7.10.1/node-v7.10.1-linux-armv6l.tar.gz tar -xzf node-v7.10.1-linux-armv6l.tar.gz node-v7.10.1-linux-armv6l/bin/node -v
We get the package, unzip it, and the last command is supposed to return v6.2.1. Then, we have to copy it to /usr/local/
cd node-v7.10.1-linux-armv6l/ sudo cp -R * /usr/local/
We can check if it is well installed.
node -v npm -v
It should return the version in both cases. Like we have copy the files in /usr/local/ folder, we can remove those in /home folder.
rm -r node-v7.10.1-linux-armv6l rm node-v7.10.1-linux-armv6l.tar.gz
To update the installed version (not recommended):
sudo npm install npm@latest -g
Like npm relies on git, it is recommended to install it also:
sudo apt-get install git
Installation of cncjs
To install it:
sudo npm install -g cncjs@latest --unsafe-perm
Some warnings could appear concerning packages that are not maintained anymore. Ignore them.
EDIT: After some tests with cncjs, it was not working very well. It seemed a bit too much for Pi Zero. Pi 3 should be used at least.