Tested on Ubuntu 14, Ubuntu 16 and Windows 10 WSL.
- Purge the old version of nodejs & npm
- Set up PPA and update
- Install the nodejs
# Using Ubuntu
sudo apt-get purge nodejs npm
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
apt-get purge nodejs npm
curl -sL https://deb.nodesource.com/setup_6.x | bash -
apt-get install -y nodejs