首页 > 解决方案 > Heroku 没有运行我的机器人 discord.js 并导致错误

问题描述

每次 heroku 运行我的机器人时,我都会收到此错误:

2020-08-31T14:55:51.202566+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-08-31T14:55:51.221755+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-08-31T14:55:51.282351+00:00 heroku[web.1]: Process exited with status 137
2020-08-31T14:55:51.317667+00:00 heroku[web.1]: State changed from starting to crashed

这是我的 ProcFile:

worker: node index.js

我的 Package.json:

{
  "name": "yuuto-giveaway",
  "version": "1.0.0",
  "description": "A Giveaway Bot",
  "main": "index.js",
  "dependencies": {
    "discord.js": "^12.3.1",
    "fs": "^0.0.1-security",
    "ms": "^2.1.2",
    "path": "^0.12.7"
  },
  "devDependencies": {},
  "scripts": {
    "start": "node index.js"
  },
  "keywords": [
    "Fun"
  ],
  "author": "BlueFire",
  "license": "ISC"
}

我不知道如何解决它!

标签: herokudiscord.js

解决方案


2020-08-31T14:55:51.202566+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

这是 Heroku 在他们的程序中的错误,这不是你的错。尝试重新创建、重新上传或从 Heroku 更改主机。试试Glitch,它对于免费主机来说效果很好。尽管我建议您不要使用 Heroku 和Glitch 之类的免费主机,因为它们 [非常] 不可靠。


推荐阅读