Ubuntu18.04 installation nodejs
1. Download and install node.js
https://nodejs.org/en/download/current/
2. After the download is complete the next move to / usr / local unzipped
Because of the downloaded file is .tar.xz file, which is compressed layers, the outer layer is xz compression method, there is a layer of tar compression
sudo xz -d filename.tar.xz
sudo tar -xvf filename.tar
3. Establish a link to the /usr/local/bin/
directory
sudo ln -s /usr/local/nodejs/bin/node /usr/local/bin/node
sudo ln -s /usr/local/nodejs/bin/npm /usr/local/bin/npm