微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

尝试使用 pm2 启动 node.js 应用程序时出错:

如何解决尝试使用 pm2 启动 node.js 应用程序时出错:

Getting this in pm2 logs,already restarted & killed & flushed logs but still,the problem persists.

当我尝试在运行 pm2 时部署我的应用程序时发生此错误

[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/home/ubuntu/.pm2/pm2.log last 15 lines:
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] online
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] starting in -fork mode-
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] online
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] starting in -fork mode-
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] online
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-05-13T07:04:37: PM2 log: App [index:0] starting in -fork mode-
PM2        | 2021-05-13T07:04:38: PM2 log: App [index:0] online
PM2        | 2021-05-13T07:04:38: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-05-13T07:04:38: PM2 log: App [index:0] starting in -fork mode-
PM2        | 2021-05-13T07:04:38: PM2 log: App [index:0] online
PM2        | 2021-05-13T07:04:38: PM2 log: App [index:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-05-13T07:04:38: PM2 log: Script /home/ubuntu/M-9/index.js had too many unstable restarts (16). Stopped. "errored"

/home/ubuntu/.pm2/logs/index-out.log last 15 lines:
/home/ubuntu/.pm2/logs/index-error.log last 15 lines:
0|index    | Require stack:
0|index    | - /home/ubuntu/M-9/index.js
0|index    |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
0|index    |     at Module.Hook._require.Module.require (/home/ubuntu/.nvm/versions/node/v14.5.0/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
0|index    |     at require (internal/modules/cjs/helpers.js:75:18)
0|index    |     at Object.<anonymous> (/home/ubuntu/M-9/index.js:1:17)
0|index    |     at Module._compile (internal/modules/cjs/loader.js:1201:30)
0|index    |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
0|index    |     at Module.load (internal/modules/cjs/loader.js:1050:32)
0|index    |     at Function.Module._load (internal/modules/cjs/loader.js:938:14)
0|index    |     at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v14.5.0/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|index    |     at Module._compile (internal/modules/cjs/loader.js:1201:30) {
0|index    |   code: 'MODULE_NOT_FOUND',0|index    |   requireStack: [ '/home/ubuntu/M-9/index.js' ]
0|index    | }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。