How to Install Latest Node.js 20 on Ubuntu with PPA
Node.js is a platform built on Chrome’s JavaScript runtime to build fast and scalable network applications. The latest version of the Node.js PPA is maintained by its official website.
Add Nodesource PPA
Add the PPA to the Ubuntu system by running the following command.
apt-get install curl
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
Output:
root@vps:~# curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
2024-02-12 14:27:55 - Installing pre-requisites
2024-11-26 16:13:43 - Installing pre-requisites
Hit:1 http://de.archive.ubuntu.com/ubuntu oracular InRelease
Get:2 http://de.archive.ubuntu.com/ubuntu oracular-updates InRelease [126 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu oracular-backports InRelease [126 kB]
Get:4 http://security.ubuntu.com/ubuntu oracular-security InRelease [126 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu oracular-updates/main amd64 Packages [81.6 kB]
Install Node.js
Installing the latest version of Node.js is now possible by running the following command,
apt-get install nodejs
Output:
root@vps:~# apt-get install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.
Need to get 31.8 MB of archives.
After this operation, 197 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_20.x nodistro/main amd64 nodejs amd64 20.18.1-1nodesource1 [31.8 MB]
Fetched 31.8 MB in 1s (54.5 MB/s)
Selecting previously unselected package nodejs.
(Reading database ... 87826 files and directories currently installed.)
now let's check the version of the Node.js installed,
node -v
Output:
root@vps:~# node -v
v20.18.1
Done!
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS