1

I'm doing web automation by using Puppeteer with NodeJS. It works fine when I'm logged in to the terminal. I'm using ec2 instance Ubuntu 22 server.

But when I'm exit out of the terminal and then try to perform the task it just loads and loads and do nothing. But when I log in to check the pm2 logs then it starts working again with the terminal open.

When I check pm2 logs I get this error every time.

Error in pm2 logs: Error in pm2 logs

JustAG33K
  • 1,403
  • 3
  • 13
  • 28
RandumbOne
  • 49
  • 5

2 Answers2

2

I suppose there is problem with the command you are trying to run the app. Use the following command to run the app via pm2.

npx pm2 start app
Mazan Labeeb
  • 154
  • 1
  • 10
0

For Cpanel Users having this issue

Login to your WHM account, click on the terminal, cd into the directory where your node js application is, then pm2 start .This was how i solved my issue.