Node.js Selector on CloudLinux

Tarak Nath

Well-Known Member
Mar 12, 2018
97
14
8
India
cPanel Access Level
Root Administrator
Thank you for the update.

We have also configured NodeJS in our dedicated server using Node.js selector with the help of resource Node.js Selector | Documentation as we are using CloudLinux7.6. We have also configured a sample NodeJS chat application from github.com/socketio/chat-example']socketio/chat-example which is working fine.

But we are unable to execute the command 'node' or 'npm' via root terminal or cPanel terminal.

Bellow is the output of root terminal:
Code:
[email protected] [~]# which node
[email protected] [~]# which npm
[email protected] [~]# node --version
-bash: node: command not found
[email protected] [~]# npm --version
-bash: npm: command not found
[email protected] [~]#
And below is the output of cPanel user terminal:
Code:
[email protected] [~]# node --version
bash: node: command not found
[email protected] [~]# npm --version
bash: npm: command not found
Any suggestion would be appreciated.

Thanks,
Tarak Nath
 
Last edited by a moderator:

Tarak Nath

Well-Known Member
Mar 12, 2018
97
14
8
India
cPanel Access Level
Root Administrator
Hello,

We have noticed 'node' and 'npm' command only working when we run the below command:

Code:
source /home/username/nodevenv/public_html/nodejs/10/bin/activate
But its not working once terminal closed.

Regards,
Tarak Nath
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

For anyone else reading this thread, keep in mind the CloudLinux Node.JS Selector feature is independent of of cPanel's Node.JS implementation. CloudLinux provides their own NodeJS RPM as part of their own EasyApache 4 YUM repo. cPanel & WHM documents such as Guide+to+Node.js+Installations are not tested on CloudLinux.

The document to reference when using Node.JS with CloudLinux is found on the link below:

Node.js Selector | Documentation

@Tarak Nath, the CloudLinux documentation states the following:

After activation user can use npm and node from a virtual environment without full paths.
If you have confirmed you are logged in via SSH as the account username and not root, then I recommend contacting CloudLinux directly to report the issue:

CloudLinux

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello @Tarak Nath,

CloudLinux has yet to publish the most recent ea-ruby24-mod_passenger RPM to their EasyApache 4 YUM repo. I recommend using Node.JS Selector if you're using CloudLinux for the time being.

Thank you.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

To update, CloudLinux is planning to publish an updated ea-ruby24-mod_passenger RPM to their EasyApache 4 YUM repo next week. I'll update this thread once it's published.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello @Tarak Nath,

CloudLinux published the updated RPM to their beta YUM repo. If you have a non-production machine that you'd like to test this on, you can execute the following command to replace the existing RPMs with the beta RPMs:

Code:
yum update ea-ruby24-mod_passenger* --enablerepo=cl-ea4-testing
To know when the update is published to the production repos, follow the CloudLinux blog for updates.

Thank you.