Step 1 - Add Node.js PPA
The Node.js package is available in the LTS release and the current release. It’s up to the user to select the version of Node that is required. Run the following command to add the PPA to the Ubuntu system:
sudo apt-get install curl
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
16.x is the latest LTS version of node available.
Step 2 - Install Node.js on Ubuntu
After successfully adding the PPA to the system, execute the command below to install Node on Ubuntu:
sudo apt-get install nodejs
Step 3 - Verification
To verify any installation, check the version number of the installed software. For node, run the following command:
node -v
If the correct version number is displayed on the terminal, the installation of Node on your system was successful.