简体   繁体   中英

cound't start express app using pm2

I do nodemon it's fine but too bad nodemon isn't restart the app when something happened.

Where's what i've tried in my ubuntu server :

  1. npm install pm2 -g
  2. go to my app directory and do pm2 start app.js
  3. pm2 startup ubuntu

My app still has 502 bad gateway error. Sigh why does this happens? I do nodemon it's running.. Strange thing is in the terminal pm2 did show an app and it's online :(

1) Check if your application is listed in PM2, use the command pm2 list

2) Running apps should be listed, you can either find an online or errored status for each app

在此处输入图片说明

3) If your app is online , try to curl localhost:port ( if this works, something is wrong with your firewall or nginx / apache configuration)

4) If it is errored , please check pm2 log - ~/.pm2/pm2.log '

如果 pm2.log 显示“...有太多不稳定重启...”,请尝试解决方案https://stackoverflow.com/a/30651668/3054511

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM