Using Node Version Manager (NVM)
xxxxxxxxxx
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install node
nvm use node
xxxxxxxxxx
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install nodejs
npm install -g npm@latest
xxxxxxxxxx
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install nodejs
npm install -g npm@latest
xxxxxxxxxx
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install nodejs
# Check node version
node -v
# v13.9.0
# Also, check the npm version
npm -v
# 6.13.7
xxxxxxxxxx
// npm node version menages packages global install
sudo su
npm install -g n
sudo n 14.0.0
exit
Latest instructions for debian/ubuntu
xxxxxxxxxx
https://github.com/nodesource/distributions