Atlantic.Net Blog

How to Install Node.js and NPM on Oracle Linux 8

Hitesh Jethva
by Atlantic.Net (414 posts) under Dedicated Server Hosting, Tutorials
0 Comments

Node.js is a free and open-source JavaScript library that is used to build scalable network applications. It is built on Chrome’s V8 JavaScript engine and allows you to develop complex and very scalable web applications easily. Node.js is designed for the back-end application. However, you can also use it as a full-stack and front-end solution. It is cross-platform and runs on different platforms including Windows, Linux, Unix, and Mac OS X. It is simple, lightweight, and supports a non-blocking I/O model and event-driven architecture.

In this post, we will show you how to install Node.js and NPM on Oracle Linux 8.

Prerequisites

  • A server running Oracle Linux 8 on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Oracle Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2 – Install Node.js Using Oracle Linux Repository

By default, Node.js is included in the Oracle Linux AppStream repository. You can list all available Node.js versions using the following command:

dnf module list nodejs

You should see the following output:

Last metadata expiration check: 0:04:25 ago on Saturday 11 June 2022 01:17:07 AM EDT.
Oracle Linux 8 Application Stream (x86_64)
Name                    Stream                       Profiles                                               Summary                           
nodejs                  10 [d][x]                    common [d], development, minimal, s2i                  Javascript runtime                
nodejs                  12 [x]                       common [d], development, minimal, s2i                  Javascript runtime                
nodejs                  14 [x]                       common [d], development, minimal, s2i                  Javascript runtime                
nodejs                  16 [x]                       common [d], development, minimal, s2i                  Javascript runtime                

To install the Node.js version 14 from the above list, run the following command:

dnf module install nodejs:14

To verify the Node.js version, run the following command:

node -v

Sample output:

v14.18.2

To verify the NPM version, run the following command:

npm -v

Sample output:

6.14.15

Step 3 – Install Node.js From NodeSource Repository

By default, the latest version of Node.js is not available in the Oracle Linux 8 default repo, so you can use the NodeSource repository to install the latest version of Node.js.

First, install the curl command utility with the following command:

dnf install curl -y

Next, add the NodeSource repository for version 17 using the following command:

curl -sL https://rpm.nodesource.com/setup_17.x | bash -

To install the latest Node.js version, run the following command:

dnf install nodejs

After the installation, verify the Node.js version with the following command:

node -v

You should see the following output:

v17.9.0

To verify the NPM version, run the following command:

npm -v

You should see the following output:

8.5.5

Step 4 – Install Node.js Using NVM

NVM stands for Node Version Manager, which provides an easy way to install and manage multiple Node.js versions in the same system.

To install NVM, run the following command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

This command will install NVM to your system and add the NVM path to the .bashrc file.

Next, activate the NVM system path using the following command:

source ~/.bashrc

You can now verify the NVM version using the following command:

nvm --version

You should see the following output:

0.35.3

To install the latest Node.js version, run the following command:

nvm install node

You should see the following output:

Downloading and installing node v18.3.0...
Downloading https://nodejs.org/dist/v18.3.0/node-v18.3.0-linux-x64.tar.xz...
####################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.3.0 (npm v8.11.0)
Creating default alias: default -> node (-> v18.3.0)

To install the latest stable Node.js version, run the following command:

nvm install --lts

You should see the following output:

Installing latest LTS version.
Downloading and installing node v16.15.1...
Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz...
####################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.15.1 (npm v8.11.0)

To list all Node.js versions installed in your system, run the following command:

nvm ls

You should see the following output:

->     v16.15.1
        v18.3.0
         system
default -> node (-> v18.3.0)
node -> stable (-> v18.3.0) (default)
stable -> 18.3 (-> v18.3.0) (default)

To set the default Node.js version, run the following command:

nvm use 18.3.0

You should see the following output:

Now using node v18.3.0 (npm v8.11.0)

Conclusion

This guide taught us how to install Node.js using three different ways on Oracle Linux 8. You can now choose your preferred method to install the Node.js on Oracle Linux 8. Give it a try on your dedicated server from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Top 10 Best Cybersecurity Training Services
How to Install Ansible on Oracle Linux 8
How to Install LEMP Server on Oracle Linux 8
How to Install and Configure Apache Webserver on Oracle Linux 8
How to Install and Configure Nginx Webserver on Oracle Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Dallas, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources