最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

为什么我在heroku上的应用在30秒后崩溃?

IT培训 admin 16浏览 0评论

为什么我在heroku上的应用在30秒后崩溃?

我在discord.js上创建了一个discord机器人,当我在本地运行它时,它可以完美运行。但是,当我在约30秒钟后在Heroku上启动此bot时,它在日志中以行崩溃:

State changed from starting to crashed

我做了一些研究,但没有找到解决方法。

所有日志:

2020-05-07T14:57:21.053472+00:00 app[web.1]: 
2020-05-07T14:57:21.053500+00:00 app[web.1]: > [email protected] start /app
2020-05-07T14:57:21.053501+00:00 app[web.1]: > node .
2020-05-07T14:57:21.053501+00:00 app[web.1]: 
2020-05-07T14:57:22.663961+00:00 app[web.1]: Online!
2020-05-07T14:58:18.856622+00:00 heroku[web.1]: State changed from starting to crashed

[请帮助,也为我的英语不好对不起。

回答如下:

我不确定百分之一百,但我认为您没有Procfile

// Procfile

worker: node index.js

^ Procfile必须具有大写.Procfile

然后转到heroku上的应用程序,如果操作正确,则应该在资源标签中看到此内容

应阅读:

https://medium/@mason.spr/hosting-a-discord-js-bot-for-free-using-heroku-564c3da2d23f

https://devcenter.heroku/articles/request-timeout

链接:

https://github

https://heroku

为什么我在heroku上的应用在30秒后崩溃?

我在discord.js上创建了一个discord机器人,当我在本地运行它时,它可以完美运行。但是,当我在约30秒钟后在Heroku上启动此bot时,它在日志中以行崩溃:

State changed from starting to crashed

我做了一些研究,但没有找到解决方法。

所有日志:

2020-05-07T14:57:21.053472+00:00 app[web.1]: 
2020-05-07T14:57:21.053500+00:00 app[web.1]: > [email protected] start /app
2020-05-07T14:57:21.053501+00:00 app[web.1]: > node .
2020-05-07T14:57:21.053501+00:00 app[web.1]: 
2020-05-07T14:57:22.663961+00:00 app[web.1]: Online!
2020-05-07T14:58:18.856622+00:00 heroku[web.1]: State changed from starting to crashed

[请帮助,也为我的英语不好对不起。

回答如下:

我不确定百分之一百,但我认为您没有Procfile

// Procfile

worker: node index.js

^ Procfile必须具有大写.Procfile

然后转到heroku上的应用程序,如果操作正确,则应该在资源标签中看到此内容

应阅读:

https://medium/@mason.spr/hosting-a-discord-js-bot-for-free-using-heroku-564c3da2d23f

https://devcenter.heroku/articles/request-timeout

链接:

https://github

https://heroku

发布评论

评论列表 (0)

  1. 暂无评论