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

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

问题描述

我正在尝试设置 Heroku 来托管我的 Discord 机器人.我确信我已经正确设置了我的 Procfile,但是工作人员 dyno 没有出现在资源下.只有 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?

过程文件

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 工人 dyno 也没有出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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