gpt4 book ai didi

node.js - 使用 Heroku 部署时 Discord 应用程序错误 R10

转载 作者:搜寻专家 更新时间:2023-10-31 23:30:22 25 4
gpt4 key购买 nike

我尝试将使用 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",
}
}

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

我该如何解决这个问题?

最佳答案

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

worker: node app.js

通过转到您的 Heroku app dashboard 确保这个新的 worker dyno 处于事件状态> 你的应用程序 > 资源(你可以使用铅笔按钮打开/关闭测功机)

关于node.js - 使用 Heroku 部署时 Discord 应用程序错误 R10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51984638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com