【问题标题】:Discord app error R10 when deploying with Heroku使用 Heroku 部署时出现 Discord 应用程序错误 R10
【发布时间】:2019-01-29 18:21:02
【问题描述】:

我尝试将使用 Node.js 制作的 discord 机器人部署到 Heroku,构建成功但应用崩溃并抛出错误:

Error R10 (Boot timeout)
Web process failed to bind to $PORT within 60 seconds of launch

我的Procfile

web: node app.js

package.json:

{
  "name": "bot",
  "version": "5.0",
  "description": "Discord Bot",
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "author": "me",
  "license": "MIT",
  "dependencies": {
    "discord.js": "^11.3.2",
    "ffmpeg-binaries": "^3.2.2-3",
  }
}

我的应用需要几秒钟才能在本地启动。

我该如何解决这个问题?

【问题讨论】:

    标签: node.js heroku discord.js


    【解决方案1】:

    这是因为您没有建立网站,但您的 dyno 设置为 web
    您可以通过将web 替换为worker 来更改Procfile 中的测功机类型:

    worker: node app.js
    

    通过转到您的Heroku app dashboard > 您的应用 > 资源,确保这个新的 worker dyno 处于活动状态(您可以使用铅笔按钮打开/关闭 dyno)

    【讨论】:

    • 天哪,您为我节省了数小时的搜索时间...太愚蠢了,它没有提供我提供的工人,而且仍然使用网络。
    • @mohkamfer 很高兴听到这个消息^_^
    猜你喜欢
    • 2016-04-15
    • 1970-01-01
    • 1970-01-01
    • 2021-01-06
    • 2018-04-07
    • 1970-01-01
    • 2017-02-04
    • 2013-02-15
    相关资源
    最近更新 更多