• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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