Pre-REQs' for the Nodejs/NPM on cPanel Web Server

For CentOS 7:

yum install ea-ruby24-mod_passenger ea-apache24-mod_env -y
yum install ea-nodejs16 -y
export PATH=$PATH:/opt/cpanel/ea-nodejs16/bin/

For CentOS 8/AlmaLinux 8/RockyLinux 8:

yum install ea-ruby27-mod_passenger ea-apache24-mod_env -y
yum install ea-apache24-mod-passenger -y
yum install ea-nodejs16 -y
export PATH=$PATH:/opt/cpanel/ea-nodejs16/bin/

If you're facing an error like the followings, while running the "npm" command: 

node: error while loading shared libraries: libbrotlidec.so.1: cannot open shared object file

To fix it, run:

yum install broccoli brotli -y

For Ubuntu 20.04 LTS:

apt install install ea-ruby27-mod_passenger ea-apache24-mod_env -y
apt install ea-apache24-mod-passenger -y
apt install ea-nodejs16 -y
export PATH=$PATH:/opt/cpanel/ea-nodejs16/bin/

To enable the NodeJS/NPM for a specific cPanel account, run: 

echo "export PATH=$PATH:/opt/cpanel/ea-nodejs16/bin/" >> /home/CPUSER/.bashrc

Note: Make sure to replace the exact cPanel username with CPUSER.

  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...