0

我正在使用 discord.js 库为不和谐制作机器人,并将它们托管在 now.js 上。但是,我在 now.js 托管方面遇到了一些烦人的问题。

当我尝试单独使用 now.js 托管应用程序时,它在 5 百万之后构建完成之前崩溃并打印

No open port found. Make sure 'npm start' creates an HTTP server on a port (any).

所以我使用 npm 添加 http 服务器并在构建时创建一个 localhost 服务器,同时我使用这个 npm start 命令启动我的机器人

http-server -p 8000 & node index

当我这样做时,构建工作正常,然后我将其扩展到 1 个永不休眠的实例,我没有任何问题。然而,几天后,应用程序崩溃并打印出来

09/05 08:44 PM (5d)
Killed
09/05 08:44 PM (5d)
npm ERR! code ELIFECYCLE
09/05 08:44 PM (5d)
npm ERR! errno 137
09/05 08:44 PM (5d)
npm ERR! Selfbot@0.1.0 now-start: `http-server -p 8000 & node index`
09/05 08:44 PM (5d)
npm ERR! Exit status 137
09/05 08:44 PM (5d)
npm ERR! 
09/05 08:44 PM (5d)
npm ERR! Failed at the Selfbot@0.1.0 now-start script.
09/05 08:44 PM (5d)
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

从这个错误中,我了解到问题在于 http 服务器停止了。这是一个问题,因为这意味着我需要每隔几天重新启动应用程序。我怎样才能防止这种情况?

4

0 回答 0