javascript - 尝试使用 pm2 启动 node.js 应用程序时出错:
问题描述
在 pm2 日志中获取此信息,已重新启动并杀死并刷新日志,但问题仍然存在。
当我在运行 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 | }
解决方案
推荐阅读
- javascript - 如何为“材料表”中的替代行添加行样式?
- windows - windows服务powershell的.exe权限
- javascript - ESLint 依赖失败
- go - uint(0) - uint(1) 输出 uint64 的 maxValue
- javascript - 如何禁用 VS Code 中 jshint 扩展中的“前导小数点可能与点混淆:'.1'”规则
- javascript - 显示无的CSS动画不起作用
- python - 尝试创建一个依赖于 python 3.6 但 Kinetic 仅支持 python 版本 2 的 ROS Kinetic 节点
- java - 如何使用 Firebase 身份验证 android studio 使用电子邮件和密码进行注册
- npm - 找不到模块:无法解析 gatsby 健全项目中的“@react-icons/all-files”
- node.js - 我尝试在本地计算机上全局安装 ionicons,但出现以下错误