1// Enabling NodeSource Repository
2// replace %V% with desired major version
3curl -sL https://deb.nodesource.com/setup_%V%.x | sudo bash -
4// Install using apt-get
5sudo apt-get install -y nodejs
6// check installed node version
7node --version
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