Install Nodejs from Nodesource
Nodejs is a cross-platform runtime, you can install it on almost every popular OS.
However, node's version managed by each OS' package manager can be different and obsolete.
So just install it from nodesource, the official script will take care of the package source and version.
Debian and Ubuntu based distributions
LTS
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
Current
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs
Enterprise Linux based distributions
LTS
# As root
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
# No root privileges
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
Current
# As root
curl -fsSL https://rpm.nodesource.com/setup_current.x | bash -
# No root privileges
curl -fsSL https://rpm.nodesource.com/setup_current.x | sudo bash -