• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Question Nodejs cron job

cipcip

Basic Pleskian
Hello, I am trying to create a cron job from a node-js application.
I am adding my full path : /usr/bin/nodejs /var/www/vhosts/something/parser.js

I get the following output: /usr/bin/nodejs: No such file or directory

If I open my terminal and check the installation using:
1. which node gives me: /usr/local/bin/node
2. which nodejs gives me: /usr/bin/nodejs

I have tried with both of them but I cannot seem to get it work, I get the same output.

Any suggestions ?

Thank you,
Cristian
 
I suppose you have to use Plesk versions of node.js:

# ll /opt/plesk/node/*/bin/node
-rwxrwxr-x. 1 500 500 41226208 Aug 30 09:15 /opt/plesk/node/10/bin/node
-rwxr-xr-x. 1 1001 psaadm 48935408 Sep 6 09:15 /opt/plesk/node/12/bin/node
-rwxr-xr-x. 1 1001 psaadm 74421432 Sep 6 09:15 /opt/plesk/node/14/bin/node
-rwxrwxr-x. 1 500 500 35028569 Aug 30 09:15 /opt/plesk/node/8/bin/node
 
I have used /opt/plesk/node/14/bin/node ... verified the folder and it exists along with the node file and received the same error: /opt/plesk/node/14/bin/node: No such file or directory

I have then tested with /opt/plesk/node/12/bin/node because if I type node -v, I receive: 12.19.0 as a version, same error ...

I do not understand what is happening
 
What is the output of command:

# ll /opt/plesk/node/*/bin/node

?
 
Hello Igor,

The output is:

ll /opt/plesk/node/*/bin/node
-rwxrwxr-x 1 500 500 41226208 Aug 27 09:18 /opt/plesk/node/10/bin/node
-rwxr-xr-x 1 1001 swkey-data 48935408 Sep 10 09:18 /opt/plesk/node/12/bin/node
-rwxr-xr-x 1 1001 swkey-data 74421432 Sep 3 09:18 /opt/plesk/node/14/bin/node
-rwxrwxr-x 1 500 500 35028569 Aug 27 09:18 /opt/plesk/node/8/bin/node
Thank you!
 
Back
Top