Jeet
Jeet

Reputation: 5659

Pm2 script not found when executing config file app.json/process.yml

I have tried using app.json and process.yml for my very simple NodeJS application. The application are group of scripts which would run as a background job in server and hence I want to do it using pm2 configuration file which looks like -

{
 "apps":[
  {
    "name":"dodge-report",
    "script":"dodge-report/dodge-report.js local"
  },
  {
    "name":"dodge-filter",
    "script":"dodge-filter/dodge-filter.js local"
  }
 ]
}

when I am trying to execute it using pm2 start app.json it one of the app works fine while other throws an error -

enter image description here

Both the path for scripts are 100% correct and scripts are in place, so wrong path or missing script file is out of question. I am not sure what is wrong any pointers would be appreciated.

Upvotes: 3

Views: 9450

Answers (1)

yodebu
yodebu

Reputation: 167

If dodge-filter/dodge-filter.js path is relative to pm2 conf execution, kindly use the paths like this : ./dodge-filter/dodge-filter.js

If you prefer giving the full system path, that should make this work too!

/var/www/html/dodge-filter/dodge-filter.js

Upvotes: 2

Related Questions