即使在Procfile中添加了Heroku worker dyno也不会出现 [英] Heroku worker dyno not showing up even though it is added in Procfile

查看:32
本文介绍了即使在Procfile中添加了Heroku worker dyno也不会出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置Heroku来托管我的Discord机器人.我确定我已经正确设置了Procfile,但是worker dyno没有出现在Resources下.只有Web dyno出现,并且在启动后立即崩溃并显示错误R10,因此无法正常工作.有人可以帮忙吗?

I am trying to set up Heroku to host my Discord bot. I am sure that I have set up my Procfile correctly, but the worker dyno doesn't show up under Resources. Only the web dyno shows up and that doesn't work as it crashes with error R10 immediately after startup. Can someone help?

Procfile

worker: node index.js

package.json

package.json

{
  "name": "bot name",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "author": "author",
  "license": "ISC",
  "dependencies": {
    "discord.js": "^12.2.0"
  }
}

日志

2020-07-28T17:03:18.000000+00:00 app[api]: Build started by user 
2020-07-28T17:03:42.000000+00:00 app[api]: Build succeeded
2020-07-28T16:58:24.618732+00:00 app[api]: Release v20 created by user
2020-07-28T16:58:24.897854+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-28T16:58:27.754015+00:00 heroku[web.1]: Starting process with command `npm start`
2020-07-28T16:58:31.218171+00:00 app[web.1]: 
2020-07-28T16:58:31.218205+00:00 app[web.1]: > bot@0.9.0 start /app
2020-07-28T16:58:31.218206+00:00 app[web.1]: > node index.js
2020-07-28T16:58:31.218206+00:00 app[web.1]: 
2020-07-28T16:58:32.169174+00:00 app[web.1]: LOG> bot is now online!
2020-07-28T16:58:35.000000+00:00 app[api]: Build started by user 
2020-07-28T16:58:58.755714+00:00 heroku[web.1]: State changed from starting to down
2020-07-28T16:58:58.660155+00:00 app[api]: Deploy 643b70ba by user 
2020-07-28T16:58:58.660155+00:00 app[api]: Release v21 created by user 
2020-07-28T16:58:59.000000+00:00 app[api]: Build succeeded
2020-07-28T16:59:28.079035+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-07-28T16:59:28.102556+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-07-28T16:59:28.220163+00:00 heroku[web.1]: Process exited with status 137

推荐答案

我删除了所有内容,然后重新设置了所有内容,现在看来可以使用了.可能是因为我没有node_modules文件夹,或者由于第一次尝试设置机器人而发生了其他错误,所以无法正常工作.

I deleted everything and set everything up again and it seems to work now. It's possible that it wasn't working because I didn't have the node_modules folder or because of some other error that happened in the first attempt of setting the bot up.

这篇关于即使在Procfile中添加了Heroku worker dyno也不会出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆