Installing node.js on Ubuntu (16.04 specifically)
how-to-install-node-js-on-ubuntu-16-04 has a great explanation, but long, about the details.
The short version come here:
- Do NOT use the ubuntu package version. It´s old and named ´nodejs´ instead of ´node´
- curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
- sudo bash nodesource_setup.sh
- sudo apt-get install nodejs
- nodejs -v (symbolic link pointing to /usr/bin/node) should print out v8.10.0 or higher
- npm is included so verify that it is working
- sudo apt-get install build-essential
In the case where you NEED multiple versions of node installed, look for the NVM section is the above link. However in most cases I don´t think this is necessary, but for advanced installations it might be.
NVM is inspired by the RVM Ruby versioning tool