Installing nodejs on your system
Run the below commands to quickly get started
sudo apt-get update
sudo apt-get install nodejs
in case you need specific version, the command be like below, otherwise continue from npm
:curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
Now, check the nodesource list:
cat /etc/apt/sources.list.d/nodesource.list
And, firing below command will install you specific version:sudo apt -y install nodejs
Then check whether node is installed or not:
node -v
If installed correctly, it should show node’s installed version [in my case, it is 14.15.4]
Again check whether npm is installed or not:
npm -v
The above command shows version, if not, fire below command to get it installed
sudo apt-get install npm
Once, installed check the version using npm -v
Removing nodejs from your system
If you want to uninstall proceed with the following steps, or if you want to reinstall then follow below steps and then again install it. So, let’s begin:
sudo apt-get purge nodejs
above command will only remove the node related packages
sudo apt-get purge --auto-remove nodejs
This command will remove the dependencies which are not needed as we have uninstalled nodejs
Collectively we can fire this command as
sudo apt-get purge --auto-remove nodejs
But, in case, you need more cautions, proceed in two steps only [Recommended]:
sudo apt-get purge nodejs
sudo apt-get autoremove
Thanks for being here, Hope you liked it.
Comment what you need more in upcoming blogs