How To Install Node.js & NPM on Ubuntu 20.04

cloudvpshosts

Member
5
2023
0
430
1. Type the command:
sudo apt update

2. Then, install Node.js with the command:
sudo apt install nodejs


3. Confirm that the installation was successful by checking the available version:
nodejs -v


4. Install the Node.js package manager (npm):
sudo apt install npm


5. Verify the installed version:
npm -v


To install development tools run the command:
sudo apt install build-essential

Remove Or Uninstall Node.js on Ubuntu​


To remove a specific version of Node.js, run the nvm uninstall command appended by the version number.
For example, to uninstall version 8.11.1 run the command:
nvm uninstall 8.11.1


To uninstall Node.js, but keep its configuration files, type:
sudo apt remove nodejs


To uninstall Node.js and remove any of its configuration files, use the command:
sudo apt purge nodejs
 
Back
Top