How To Install Node.js on Ubuntu 20.04 (Updated)
In this guide, we’ll show you how to install Node.js on Ubuntu 20.04 LTS. We need to add Node.js PPA to your Ubuntu 20.04 LTS, 18.04 LTS, 16.04 LTS systems and install it. Latest version of Node.js ppa is maintaining by its official website on Github. Node.js is one of the most popular web technologies to build network applications quickly.
Same instructions you can apply for any Debian based distribution, including Kubuntu, Linux Mint and Elementary OS.
Install Node.js on Ubuntu 20.04 with PPA #
There are several ways to install Node.js. However, we will show you the two simplest and most efficient way to install Node.js. Also, you can download the Node.js latest version via .rpm, .deb and Snap packages.
1. Add Node.js from NodeSource
This is the simplest method to install a specific version of Node.js. You can quickly follow the below steps to install Node.js 15.x, 14.x, 13.x version. To install Node.js and npm from the NodeSource repository, follow the below steps:
Currently Node.js v15.x is latest release available. First, add the latest Node.js PPA to your system to install Nodejs on Ubuntu.
curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
LTS Release (Recommended)
Currently Node.js v14.x is stable LTS release available. First, add the latest Node.js PPA to your system to install Nodejs on Ubuntu.
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
If you need to install any other previous version, change the version number. For example
2. Install Node.js on Ubuntu 20.04
Once the Node.js PPA is enabled, install Node.js using apt-get command. This will also install NPM with Node.js. Also, it will install the many other dependent packages on your systems.
sudo apt-get install -y nodejs
3. Check Installed Node.js and NPM version
Finally, Node.js and NPM successfully installed in your system. You can check and verify the installed Node.js version using the following command.
Similarly, you can check npm version using the following command.
Uninstall Node.js on Ubuntu 20.04 #
If you want to completely remove Node.js and npm packages from your systems, execute the following command.
sudo apt-get purge nodejs npm
Finally, you can run the below command to remove any unused files and free up disk space.
sudo apt-get autoremove
We hope you have found this article helpful. Let us know your questions or feedback if any through the comment section in below. You can subscribe to our newsletter and get notified when we publish new articles for free. Moreover, you can explore here other interesting articles.
If you like our article, please consider buying a coffee for us.
Thanks for your support!
Buy me a coffee!