Node js is one of the most popular programming languages in the IT industry. Here we will share with you how to install node js latest version in ubuntu 16.04 with example.
First, you make sure the node is installing in your ubuntu system or not? check this running by the following command.
node -v
// or
nodejs -v
If you did not find a node in your ubuntu server then you can now install node js in your server help of the following command. here we will share with you how to install all node js version by running the command in your terminal.
Install node v12 (Current version):
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
Install node v10 LTS (For new users: install this one):
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
Install node v8 (Old version):
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Install node v6 (Old version):
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
After installing nodejs in your ubuntu system then if you want to uninstall nodejs from the server then run the following commanat in your terminal.
Uninstall / Remove Nodejs
sudo apt-get purge nodejs
it is only removing node
related packages i.e. relevant packages, nothing more.
On the other hand, when you do:
sudo apt-get purge --auto-remove nodejs
it is necessarily doing:
sudo apt-get purge nodejs
sudo apt-get autoremove
Conclusion
As you can see, nodejs installing and uninstalling is very easy process
We hope that small tutorials help everyone. Thanks.