1sudo apt-get install curl
2curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
3sudo apt-get install nodejs
4# Check node version
5node -v
6# v13.9.0
7# Also, check the npm version
8npm -v
9# 6.13.7
1Install Nodejs using NVM
2
3curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
4source ~/.bashrc
5nvm install v14.17.1
1# install nodejs 10.x version
2sudo apt update
3cd ~
4curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
5# not important, but can be done
6nano nodesource_setup.sh
7sudo bash nodesource_setup.sh
8sudo apt install nodejs
9node install npm -g
10node --version
11npm --version
1//installing node from the terminal
2sudo apt install nodejs
3
4//installing npm
5sudo apt install npm