我是一个初级的discordbot开发人员,希望在heroku上全天候托管他的heroku bot。部署大约1分钟后,我收到一个错误:
2020-12-28T11:40:54.000493+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-12-28T11:40:54.024808+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-12-28T11:40:54.088413+00:00 heroku[web.1]: Process exited with status 137
2020-12-28T11:40:54.121927+00:00 heroku[web.1]: State changed from starting to crashed
package.json:中的代码
{
"name": "mano-county-bot",
"version": "1.0.0",
"description": "Bot for Mano County!",
"main": "index.js",
"dependencies": {
"bloxlink": "^1.6.0",
"chalk": "^4.1.0",
"discord.js": "^12.5.1",
"figlet": "^1.5.0",
"noblox.js": "^4.7.3",
"roblox-js": "^4.0.4",
"trello-node-api": "0.0.9"
},
"devDependencies": {},
"scripts": {
"start": "node index.js",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Alex_Google214",
"license": "ISC"
}
是的,我没有使用快递。
我有一段关于引擎的代码
"engines": {
"node": "14.x",
"npm": "6.x"
},
在删除该项目未部署之前。但在移除后,它部署了,然后我出现了我愿意得到帮助的错误。提前感谢!
Dynos
问题就在这里。我启用了网络dyno,禁用了Worker。但后来我禁用了网络dyno,打开了Worker,它成功了!
您必须在Procfile中定义了一个web进程:web进程将尝试绑定一个可以通过HTTPS访问的端口。如果没有发生这种情况,部署就会失败。
Discord机器人通常在后端工作(没有HTTP访问(:将Procfile更改为使用worker。