How To Install Node.js 12,10 on RHEL 8 / CentOS 8

Posted on 24 views

Welcome to our guide on how to install Node.js 12,10 LTS on CentOS 8 / RHEL 8 Linux system. Node.js is a popular free and open-source server-side programming language which runs on various platforms (Linux, Windows, Unix, macOS).

Installing Node.js 12,10 LTS on RHEL 8 / CentOS 8

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine for easily building fast, scalable network applications. To install Node.js 12,10.x LTS on RHEL 8 / CentOS, use the AppStream repository. RHEL 8 distributes Node.js 16,14,12, and 10 as of this article update.

See available Node versions on:

$ sudo dnf module list nodejs
Last metadata expiration check: 0:00:09 ago on Thu 05 May 2022 11:25:49 PM EAT.
Rocky Linux 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

The default version installed is Nodejs 10 but you can explicitly specify the version of Node.js to install.

### Node.js 12 ###
sudo dnf module install nodejs:12

### Node.js 10 ###
sudo dnf module install nodejs:10

When prompted for a y/n confirmation, press y.

Transaction Summary
=======================================================================================================================================================
Install  3 Packages

Total download size: 12 M
Installed size: 56 M
Is this ok [y/N]: y

Wait for the installation to finish then check the version:

$ node --version
v12.22.5

If you’re interested in installing Node.js v14 and v16 instead, install it like below

sudo dnf module install nodejs:16
sudo dnf module install nodejs:14

Full package details can be viewed using the rpm command.

$ rpm -qi nodejs
Name        : nodejs
Epoch       : 1
Version     : 12.22.5
Release     : 1.module+el8.4.0+647+e905fa21
Architecture: x86_64
Install Date: Thu May  5 23:30:20 2022
Group       : Development/Languages
Size        : 38168683
License     : MIT and ASL 2.0 and ISC and BSD
Signature   : RSA/SHA256, Tue Sep 21 21:23:59 2021, Key ID 15af5dac6d745a60
Source RPM  : nodejs-12.22.5-1.module+el8.4.0+647+e905fa21.src.rpm
Build Date  : Tue Sep 21 21:16:37 2021
Build Host  : ord1-prod-x86build002.svc.aws.rockylinux.org
Relocations : (not relocatable)
Packager    : [email protected]
Vendor      : Rocky
URL         : http://nodejs.org/
Summary     : JavaScript runtime
....

You may also need to install Development Tools for building Node software.

sudo dnf install -y gcc-c++ make

You now have Node.js 12 / Node.js 10 installed on your RHEl 8 server.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.