Today we will be going through the steps to install and uninstall NodeJS in Ubuntu operating system.
Install NodeJS in Ubuntu:
To begin with the installation process you will need to first add the NodeJS PPA to Ubuntu for which you can execute the following command:
sudo apt-get install software-properties-common
Once the install execution is successfully completed, execute the following command to install the NodeJS in Ubuntu:
Execute the following to update the apt-get repo:
sudo apt update
To begin the NodeJS installation, execute the following command:
sudo apt-get install nodejs
Executing this command will have the NodeJS installed in your machine and you can verify it by checking the NodeJS version number:
node -v
NodeJS version number will be displayed like the following:
Uninstall NodeJS from Ubuntu:
Just executing the following command will remove the NodeJS from the Ubuntu OS:
sudo apt-get remove nodejs
This will remove the NodeJS package:
To remove both the NodeJS and its associated configuration files, execute the following command:
sudo apt-get purge nodejs
To clear up the disk space by removing the unused files of the NodeJS, execute the following:
sudo apt-get autoremove