GNU/Linux Enterprise Adding Node JS Repo
Hi! The Guide shows you Step-by-step How to Add the Node JS Repository for Enterprise GNU/Linux 7+ Based Systems.
And with this Node JS Repo Setup you’ll be able to Install both node.js 16.x LTS, 18.x LTS, 20.x LTS, and Current.
For more insight see the official: NodeJs Repository Documentation.
So this Guide is Valid for All the Red Hat Enterprise Linux Based Distros:
- Red Hat Enterprise Linux
- CentOS
- Rocky Linux
- AlmaLinux
- Oracle Enterprise Linux
- Scientific Linux
1. Accessing Shell
Open a Shell Session
(Press “Enter” to Execute Commands)2. Adding EPEL Repository
How to Enable EPEL Repository for Enterprise GNU/Linux
-
3. Setting Up Node.js Repo
Then Add Node JS CentOS Repository Especially relevant: Node.js 18+ is supported only on CentOS 8+.
For the 20.x relase use:sudo yum install https://rpm.nodesource.com/pub_20.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
Again for 18.x:sudo yum install https://rpm.nodesource.com/pub_18.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
Otherwise for 16.x:sudo yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
Finally, due to the quick NodeJs development cycle sometimes the latest Releases may be missing from this list, in case consult: Node.js Repo on Github. 4. Installing Node.js
Now to Install NodeJs on CentOS
Play:sudo dnf install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
Or for Legacy releases:sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
-
5. Node.js Getting-Started Guide
Getting-Started with Node.js on GNU/Linux