【问题标题】:Discord.js bot | Heroku deploy error | npm ERR! missing script: startDiscord.js 机器人 | Heroku 部署错误 | npm 错误!缺少脚本:开始
【发布时间】:2021-04-26 20:54:30
【问题描述】:

这是 Heroku 日志;

2021-01-22T11:17:07.911108+00:00 heroku[web.1]: State changed from crashed to starting
2021-01-22T11:17:10.754315+00:00 heroku[web.1]: Starting process with command `npm start`
2021-01-22T11:17:15.636637+00:00 app[web.1]: npm ERR! missing script: start
2021-01-22T11:17:15.662837+00:00 app[web.1]: 
2021-01-22T11:17:15.673294+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-01-22T11:17:15.673769+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-01-22T11_17_15_637Z-debug.log
2021-01-22T11:17:15.744906+00:00 heroku[web.1]: Process exited with status 1
2021-01-22T11:17:15.806698+00:00 heroku[web.1]: State changed from starting to crashed
2021-01-22T11:17:23.632780+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hamburgerbot-djs.herokuapp.com request_id=5860703d-5eea-494e-b4d0-e052b7d90a44 fwd="176.41.220.196" dyno= connect= service= status=503 bytes= protocol=https
2021-01-22T11:17:24.442814+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hamburgerbot-djs.herokuapp.com request_id=ec0558b8-95ce-43f3-b764-8bccdfc9cc4a fwd="176.41.220.196" dyno= connect= service= status=503 bytes= protocol=https

我该如何解决这个错误?

【问题讨论】:

  • 如果您能提供一些您认为发生这种情况的代码,那将非常有用。

标签: heroku discord.js


【解决方案1】:

看起来您可能没有在 package.json 文件中定义 start 脚本。由于这个错误:2021-01-22T11:17:15.636637+00:00 app[web.1]: npm ERR! missing script: start

您可以将应用程序脚本的名称更改为 server.js 或将以下内容添加到您的 package.json

"scripts": {
    "start": "node your-script.js"
}

【讨论】:

    猜你喜欢
    • 2017-10-16
    • 2018-12-22
    • 1970-01-01
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    • 1970-01-01
    相关资源
    最近更新 更多