See source: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
curl to setup the node.js repository in your sources.
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
Now install node.js. *Note the command name changes in ubuntu, nodejs
instead of node
. This is to avoid a name conflict with a package called node
in ubuntu.
sudo apt-get install -y nodejs