我尝试使用 pm2 启动我的 APP,但它没有启动,而是无限重启

问题描述

npm start 可以很好地启动我的应用程序,但是当我这样做时:

pm2 start server.js

我明白了:

[PM2] Applying action restartProcessId on app [Huxbot](ids: [ 0 ])
[PM2] [Huxbot](0) ✓
[PM2] Process successfully started

App Image

在我得到的日志中:

PM2        | 2021-04-19T01:33:15: PM2 log: App [Huxbot] exited with code [1] via signal [SIGINT]
PM2        | 2021-04-19T01:33:15: PM2 log: App [Huxbot:0] starting in -fork mode-
PM2        | 2021-04-19T01:33:15: PM2 log: App [Huxbot:0] online
PM2        | 2021-04-19T01:33:23: PM2 log: App [Huxbot:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-04-19T01:33:23: PM2 log: App [Huxbot:0] starting in -fork mode-
PM2        | 2021-04-19T01:33:23: PM2 log: App [Huxbot:0] online
PM2        | 2021-04-19T01:33:31: PM2 log: App [Huxbot:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-04-19T01:33:31: PM2 log: App [Huxbot:0] starting in -fork mode-
PM2        | 2021-04-19T01:33:31: PM2 log: App [Huxbot:0] online
PM2        | 2021-04-19T01:33:39: PM2 log: App [Huxbot:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-04-19T01:33:39: PM2 log: App [Huxbot:0] starting in -fork mode-
PM2        | 2021-04-19T01:33:39: PM2 log: App [Huxbot:0] online
PM2        | 2021-04-19T01:33:46: PM2 log: App [Huxbot:0] exited with code [1] via signal [SIGINT]
PM2        | 2021-04-19T01:33:46: PM2 log: App [Huxbot:0] starting in -fork mode-
PM2        | 2021-04-19T01:33:46: PM2 log: App [Huxbot:0] online

这是我的 package.json:

{
"name": "Huxbot","version": "3.5.0","description": "Huxbot","main": "server.js","scripts": {
"start": "node server.js"
},"dependencies": {
"@tohru/gm": "^1.3.0","canvas": "^2.6.1","canvas-constructor": "^3.2.0","cheerio": "^0.22.0","discord-youtube-api": "^0.1.0","discord.js": "^11.5.1","express": "^4.17.1","fortnite": "^4.3.2","fs": "^0.0.2","google": "^2.1.0","google-searcher": "^1.0.0","google-translate": "^3.0.0","google-translate-api": "^2.3.0","hive-api": "^1.13.10","idiotic-api": "^0.2.11","jimp": "^0.12.0","js-robloxapi": "^1.0.6","kiz": "^1.0.1","mal-scraper": "^2.6.9","marsnpm": "^0.4.5","mega-dtbs": "^0.1.17","megadb": "^3.4.0","moment": "^2.26.0","nekos.life": "^2.0.7","node-fetch": "^2.6.0","node-opus": "^0.3.3","node-osu": "^2.2.0","opusscript": "^0.0.7","querystring": "^0.2.0","request": "^2.88.2","retrotext": "^4.0.1","simple-youtube-api": "^5.2.1","snekfetch": "^4.0.4","sqlite": "^4.0.7","sqlite3": "^4.2.0","superagent": "^5.2.2","weather-js": "^2.0.0","weeb-sh": "^0.3.3","weez": "^1.6.0","yandex-translate": "^2.1.3","ytdl-core": "^2.1.4","ms": "^2.1.2","quick.db": "^7.1.1","morgan": "^1.10.0","path": "^0.12.7","ejs": "^3.1.3","passport-discord": "^0.1.3","passport": "^0.4.1","body-parser": "^1.19.0","express-session": "^1.17.1","twilio": "^4.6.0","http": "^0.0.0","merge-descriptors": "^1.0.1","node-superfetch": "^0.1.10","common-tags": "^1.8.0","request-promise-native": "^1.0.8"
},"engines": {
"node": "10.x"
},"repository": {
"url": "https://glitch.com/edit/#!/hello-sqlite"
},"license": "MIT","keywords": [
"node","glitch","express"
]
}

我目前拥有最新版本的 node 和 pm2,这在一夜之间发生在我身上,以前从未发生在我身上 值得一提的是,这是一个不和谐的机器人项目,我是在VPS上托管的。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)