[1] Install curl
sudo apt install curl
[2] Install package - (Replace 17.x with the latest version if needed)
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash
[3] Run update Command :
sudo apt update
[4] Run below Command to install nodejs :
sudo apt install nodejs -y
[5] Once installation done, run following Command to check versions: [A] To check Node Version :
node -v
[B] To check npm version :
npm -v
[6] That's it !!