Recent news unveiled the release of Node.js 20, ushering in a wave of anticipation for its upcoming adoption as the Long-Term Support (LTS) release in October 2023.
Although this post centers on Ubuntu 20.04 LTS, with newer LTS versions and numerous non-LTS iterations available, it might seem unconventional. However, aligning with the prevalent traffic trends on my blog, Ubuntu 20.04 LTS retains a substantial user base and interest.
Moreover, the enduring support designated for Ubuntu 20.04, being a long-term support release, solidifies its relevance in the software ecosystem.
The instructions presented here are not confined solely to Ubuntu 20.04 LTS; they seamlessly apply to recent Ubuntu versions like 22.04 LTS and the freshly introduced Ubuntu 23.04, alongside various contemporary Debian versions. If your distribution aligns with either of these, the likelihood of success using these instructions remains high.
Let’s commence! First, ensuring our system is up-to-date and equipped with the necessary dependencies is imperative:
1 2 3 4 5 |
$ sudo apt update $ sudo apt upgrade $ sudo apt install -y curl |
With the system and prerequisites in place, let’s acquire the Node.js 20 setup script and initiate the process:
1 2 3 4 5 |
$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - |
This script appends the new apt sources and updates the system, preparing us for the nodejs installation, which involves one additional step:
1 2 3 4 5 |
$ sudo apt install -y nodejs |
Once nodejs is installed, verifying its successful installation is crucial. Execute the following command to confirm the version:
1 2 3 4 5 |
$ node --version v20.0.0 |
If the output version matches ‘v20.something.something’ or ‘v20.0.0’ at the time of implementation, the installation was successful! However, if it doesn’t align with the expected version, revisiting the steps or identifying any errors encountered during the process is advisable.