问题描述
我试图将用Node.js制作的不和谐机器人部署到Heroku,构建成功,但是应用程序崩溃并引发错误:
错误R10(引导超时)
$ p的60秒内未能绑定到$ PORT $ p>
Web进程在启动
我的
Procfile
:web:节点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,
}
}
我的应用在本地启动需要花费几秒钟。
我该如何解决?
解决方案这是由于f表示您没有建立网站,但您的测功机设置为
web
。
您可以在<$ c $中更改测功机类型。 c> Procfile ,将web
替换为worker
:worker:节点app.js
通过转到您的>您的应用>资源(您可以使用铅笔按钮打开/关闭测功机)
I tried to deploy my discord bot made with Node.js to Heroku, the build is successful but the app crashes and throws an error:
Error R10 (Boot timeout) Web process failed to bind to $PORT within 60 seconds of launch
My
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", } }
My app takes a few seconds to launch localy.
How can I fix this?
解决方案That's caused by the fact that you're not building a website, but your dyno is set to
web
.
You can change your dyno type in yourProcfile
by replacingweb
withworker
:worker: node app.js
Make sure this new
worker
dyno is active by going to your Heroku app dashboard > your app > resources (you can use the pencil buttons to turn on/off dynos)这篇关于使用Heroku部署时出现Discord应用程序错误R10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!