install nodejs on ubuntu 20.04 code example

Example 1: ubuntu 20.04 how to install npm

sudo apt update
sudo apt install nodejs npm

Example 2: install nodejs ubuntu 20.04

sudo apt install nodejs

Example 3: ubuntu 20 lts install node 10

# install nodejs 10.x version 
sudo apt update
cd ~
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
# not important, but can be done
nano nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
node install npm -g
node --version
npm --version

Example 4: npm install ubuntu 20.04

$ sudo apt install nodejs

Example 5: install node 14 ubuntu 20

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -Copy

Example 6: install nodejs from ubuntu 18.04

sudo bash nodesource_setup.sh