DEV Community

loading...
Cover image for Install Node.js on Ubuntu 20.04

Install Node.js on Ubuntu 20.04

SittingDev
Just another dev sitting at his computer.
Originally published at sittingdev.com ・1 min read

Learn how to install Node.js and NPM on Ubuntu 20.04 LTS with this quick tutorial.

Find the latest version of Node.js through the apt repository.

sudo apt-cache show nodejs

The apt repository version is often outdated compared to the latest long-term support version available on the Node.js website. So we will install it from there instead.

Go to the Node.js website - https://nodejs.org/en/.

Click on the 'other downloads' link and navigate to 'install node.js via package manager'.

Go to this URL - https://github.com/nodesource/distributions/blob/master/README.md.

Scroll down until you find the LTS version of Node.js and proceed to the next step.

To install Node.js you will need to make sure you have curl installed.

curl --version

If you need to install curl -

sudo apt install curl

Now go back to the github page we opened and proceed to follow the instructions.

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Once this has run, you will want to check the version to confirm that node has installed as it should.

node --version

You can also check the NPM version as it was installed with Node in this case.

npm --version

Discussion (0)