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

  • 0

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


Was this answer helpful?

« Back

Send Message