1
votes

I builded a node project with Express and Mongo, I want to deploy in a Ubuntu server in AWS using PM2, I've try start my process using a json config:

{
  "apps" : [{
    "name"        : "notification_eva02",
    "script"      : "bin/www",
    "watch"       : "../",
    "log_date_format"  : "YYYY-MM-DD HH:mm Z"
  }]
}

and run command:

pm2 start processes.json

enter image description here

But When I check pm2 list

enter image description here

I have:

  • pm2 -v (2.1.6)
  • node -v (v4.2.6)
  • npm --version (3.5.2)
  • Ubuntu Server 16.04

The rarest thing is that on my windows 10 it works pm2

I hope anyone can help me in my problem

2

2 Answers

0
votes

You have activated the watch & restart mode, I guess some files are changing and so your application get restarted automatically. Try disable the watch mode and see if your application does not restarts.

0
votes

well, maybe you have setup log file path under your project folder, so when you startup pm2, it wrotes something into the log file, thats make a file "changed", when the file changed the pm2 will restart, so always changed and always restart loop, so you can add these log files path into "ignore_watch" options and solved it.