How To Install Node.js on AlmaLinux 8

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
Output
AlmaLinux 8 - AppStream
Name Stream Profiles Summary
nodejs 10 [d] common [d], development, minimal, s2i Javascript runtime
nodejs 12 common [d], development, minimal, s2i Javascript runtime
nodejs 14 common [d], development, minimal, s2i Javascript runtime
nodejs 16 common [d], development, minimal, s2i Javascript runtime

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
Output
Installed:
nodejs-1:16.13.1-3.module_el8.5.0+2605+45d748af.x86_64
nodejs-docs-1:16.13.1-3.module_el8.5.0+2605+45d748af.noarch
nodejs-full-i18n-1:16.13.1-3.module_el8.5.0+2605+45d748af.x86_64
npm-1:8.1.2-1.16.13.1.3.module_el8.5.0+2605+45d748af.x86_64

Complete!

When your installation is completed, you can verify your Node.js installation on AlmaLinux 8 by checking its version:

node --version
Output
v16.13.1

Also, check the NPM version:

npm --version
Output
8.1.2

Conclusion

At this point, you learn to Install Node.js on AlmaLinux 8.

Hope you enjoy it.

You may be interested in these articles too:

How To Install and Use Dotnet on AlmaLinux 8

Install and Configure WordPress on AlmaLinux 8

How To Install and Secure Laravel on AlmaLinux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!