Back to the homepage
Learn how to install Node.js and NPM on Ubuntu 20.04 LTS with this quick tutorial.
Cliok here to watch my video tutorial instead
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.
Click on the ‘other downloads’ link and navigate to ‘install node.js via package manager’.
Go to the node Github.
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.
If you need to install cURL
sudo apt install curl
Now go back to the Github page we opened and 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.
You can also check the NPM version as it was installed with Node in this case.