In this article from the Linux Tutorials, we want to teach you How To Install Node.js on AlmaLinux 8.
Node.js is an open-source, cross-platform runtime environment and library that is used for running web applications outside the client’s browser.
It is used for server-side programming, and primarily deployed for non-blocking, event-driven servers, such as traditional websites and back-end API services, but was originally designed with real-time, push-based architectures in mind.
The fact that Node.js is open source means that it is free to use and constantly being tweaked and improved by a global community of developers.
How To Install Node.js on AlmaLinux 8
Before you start to install Node.js, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article the Initial Server Setup with AlmaLinux 8.
Now you can follow the steps below to complete this guide.
Set up Node.js and NPM on AlmaLinux 8
First, you need to update your local package index with the following command:
sudo dnf update -y
To install the latest release of Node.js, you don’t need to add any repository manually to get the packages for the installation of this Java programing language and its package manager.
CentOS and RHEL 8 along with other RPM Linux already have a dedicated module for it.
At this point, you can see what versions of Node.js are available on AlmaLinux 8 with the command below:
sudo dnf module list nodejs
AlmaLinux 8 - AppStream
Name Stream Profiles Summary
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
As you can see, the default version of Node.js is 10 and the latest version of it is 16.
To enable the latest LTS one that is 16 to install by default on the system, run the following command:
sudo dnf module enable nodejs:16
Then, you can use the command below to install Node.js on your server:
sudo dnf install nodejs
When your installation is completed, you can verify your Node.js installation on AlmaLinux 8 by checking its version:
Also, check the NPM version:
At this point, you learn to Install Node.js on AlmaLinux 8.
Hope you enjoy it.
You may be interested in these articles too: