Heroku没有运行我的机器人discord.js并导致错误

时间:2020-08-31 15:00:07

标签: 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"
}

我不知道如何解决!

1 个答案:

答案 0 :(得分:0)

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之类的免费主机,因为它们[绝对]不可靠。