curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
Note: Please avoid to install Node.js with apt-get on Ubuntu. If you already installed Node.js with the built in package manager, please remove that. Run the following commands:
sudo apt-get purge nodejs
sudo apt-get autoremove && sudo apt-get autoclean
nvm list
nvm install v10.15.1
nvm list-remote
You can also view them here: https://nodejs.org/en/download/releases/
nvm use v10.15.1
node -v
nvm alias default 6.1.0
sudo apt install npm