How to Install Node.js in RHEL 8

Node.js is a lightweight and powerful JavaScript run-time environment platform which is based on Chrome’s V8 JavaScript engine and it is used to create scalable network applications.

In this article, we will guide you on how to install the latest version of Node.js in RHEL 8 Linux distribution.

Requirements:

  1. RHEL 8 with Minimal Installation
  2. RHEL 8 with RedHat Subscription Enabled
  3. RHEL 8 with Static IP Address
  4. How to Setup a Developer Workstation in RHEL 8

Installing Node.js on RHEL 8

1. To install the latest version of Node.js, you need to install development tools such as make, git, gcc on your system using the following dnf command.

# dnf groupinstall "Development Tools" 
Install Development Tools on RHEL 8
Install Development Tools on RHEL 8

2. Next, check the available Node.js package contained in the Application Stream Repository using the following command.

# dnf module list nodejs
Check Node.js Module
Check Node.js Modules

3. Next, install the default Node.js module by running the following command.

# dnf module install nodejs
OR
# dnf install @nodejs 
Install Node.js on RHEL 8
Install Node.js on RHEL 8

If you are a developer, you can use the development profile to install the libraries that enable you to build dynamically loadable modules, as follows:

# dnf module install nodejs/development

4. To install a minimal set of Node.js packages, run the following command.

# dnf module install nodejs/minimal

5. Once you have installed Node.js on your system, use the following commands to check the version and location of the nodejs.

# node -v
# npm -v 
# which node 
# which npm 
Verify Node.js Installation
Verify Node.js Installation

If you are new to Node.js, the following guides should get you started with learning and using it for application development:

  1. How to Write Your First Node.js App in Linux
  2. 14 Best NodeJS Frameworks for Developers in 2019
  3. How to Configure Nginx as Reverse Proxy for Nodejs App
  4. How to Install PM2 to Run Node.js Apps on Production Server

That’s all for now! If you have any queries or additions, don’t hesitate to let us know via the feedback form below.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

Aaron Kili
Aaron Kili
Contributor
About the author

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.