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
install node for linux
xxxxxxxxxx
#Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
#Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
apt-get install -y nodejs
# for more info/versions check here
# https://github.com/nodesource/distributions/blob/master/README.md
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
// npm node version menages packages global install
sudo su
npm install -g n
sudo n 14.0.0
exit
xxxxxxxxxx
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js
nvm install 20
# verifies the right Node.js version is in the environment
node -v # should print `v20.14.0`
# verifies the right NPM version is in the environment
npm -v # should print `10.7.0`