为什么PM2不考虑清晰的退出代码1错误?

发布于 2025-02-09 18:22:20 字数 348 浏览 1 评论 0原文

我有2个项目在节点V16上运行,一个PM2的旧版本。将节点升级到V16后,两者都停止重新启动错误。我已经将一个升级到PM2 v5.2.0,并解决了问题。

但是,另一个项目仍未重新启动。我尝试仅使用项目中的第一个功能引发的错误进行测试,并使用代码1退出,但是PM2继续显示其状态为在线。直接从Bash运行它使其崩溃,因此没有充分的理由不检测到这一点。

我非常简单地开始我的过程 - pm2开始名称= project -name yarn-运行start:prod。这两个项目都是这样启动的。

PM2的GitHub问题充满了有关此的报道,但没有人回答大多数。也许以前遇到过的人有技巧?

I had 2 projects running on Node v16 and an old version of PM2. After upgrading node to v16, both stopped restarting on error. I've upgraded one to PM2 v5.2.0 and it fixed the issue.

However, the other project still does not restart. I tried testing using just an error thrown from the first function called in the project and it exits with code 1, but PM2 continues showing its status as online. Running it directly from bash makes it crash, so there's no good reason for PM2 not to detect that.

I start my process very simply - pm2 start name=project-name yarn -- run start:prod. Both projects are launched like this.

PM2's Github issues are full of the reports of this, but no one replies to most of them. Maybe someone who has run into this previously has tips?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文