$ sudo apt-get install nodejs
$ sudo apt-get install npm
$ sudo npm install -g bower
Ese comando te devolverá la versión de Node.js que se ha instalado.
$ node -v
$ npm -v
In ubuntu 16.04 nodejs 8
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
Run to install Node.js 8.x LTS Carbon and npm
sudo apt-get install -y nodejs`
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh