Question
How do you install NodeJS using the command line?
Answer
The Application Manager in cPanel allows users to deploy Phusion Passenger applications, including NodeJS apps. To install a cPanel-provided version of NodeJS on your system, you'll need to install the supporting packages. This article provides the steps to install those packages.
Note: CloudLinux allows users to use multiple versions of NodeJS through NodeJS Selector, so CloudLinux users may wish to install the CloudLinux-provided version of NodeJS instead.
Note: In the following commands, "$nodeversion" must be replaced with the desired NodeJS version (i.e., ea-nodejs16, ea-nodejs18, or ea-nodejs20).
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
-
Use
dnfto install the needed packages:# dnf install ea-apache24-mod_env ea-ruby27-mod_passenger $nodeversion
-
Verify that NodeJS has been installed correctly:
# /opt/cpanel/$nodeversion/bin/node -v
Note: In the following commands, "$nodeversion" must be replaced with the desired NodeJS version (i.e., ea-nodejs16, ea-nodejs18, or ea-nodejs20).
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
-
Use
aptto install the needed packages:# apt install ea-apache24-mod-env ea-apache24-mod-passenger $nodeversion
-
Verify that NodeJS has been installed correctly:
# /opt/cpanel/$nodeversion/bin/node -v
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
-
Use
yumto install the needed packages:# yum install ea-apache24-mod_env ea-apache24-mod-passenger ea-nodejs16
-
Verify that NodeJS has been installed correctly:
# /opt/cpanel/ea-nodejs16/bin/node -v
Comments
0 comments
Article is closed for comments.