【问题标题】:pm2 is not working in amazon ec2 with node applicationpm2 无法在带有节点应用程序的亚马逊 ec2 中工作
【发布时间】:2018-04-11 03:33:41
【问题描述】:

我在亚马逊 ec2 中托管了节点应用程序。 我使用 nginx 将其指向我的域。 当我使用 npm start 运行应用程序时,它运行完美。 但是当我使用 pm2 时,它不起作用。

pm2 list command shows that the app is running.

但是网址不起作用。即使当我再次运行 npm start app gets started 时,它也清楚地表明该端口是免费的。所以 pm2 实际上并没有在该端口上运行任何东西。但是 pm2 说应用程序在线。

【问题讨论】:

    标签: node.js nginx amazon-ec2 npm pm2


    【解决方案1】:

    我从 pm2 运行了错误的文件。因为是 express 项目,所以我不得不运行 bin/www

    所以下面的命令解决了这个问题:

    pm2 start bin/www
    

    这里也回答了:

    https://github.com/Unitech/pm2/issues/3252

    谢谢

    【讨论】:

      猜你喜欢
      • 2017-11-30
      • 1970-01-01
      • 1970-01-01
      • 2014-03-14
      • 1970-01-01
      • 2015-04-16
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      相关资源
      最近更新 更多