【问题标题】:I ran into application error after i deployed Node js successfully on Heroku [closed]在 Heroku 上成功部署 Node js 后,我遇到了应用程序错误 [关闭]
【发布时间】:2021-08-31 12:20:39
【问题描述】:

这是我第一个使用节点的代码,它在 locahost:3000 上运行良好 这是我检查日志后的错误:

```2021-08-31T11:16:54.000000+00:00 app[api]: Build succeeded
2021-08-31T11:16:57.474525+00:00 heroku[web.1]: Starting process with command `npm start`
2021-08-31T11:16:59.311657+00:00 app[web.1]: npm ERR! missing script: start
2021-08-31T11:16:59.314538+00:00 app[web.1]: 
2021-08-31T11:16:59.314674+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-08-31T11:16:59.314721+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-08-31T11_16_59_312Z-debug.log
2021-08-31T11:16:59.351913+00:00 heroku[web.1]: Process exited with status 1
2021-08-31T11:16:59.406151+00:00 heroku[web.1]: State changed from starting to crashed
2021-08-31T11:17:31.920808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=web-facebock.herokuapp.com request_id=a8bc0829-78b8-4ed9-93f4-c389ee0dcb39 fwd="197.210.77.72" dyno= connect= service= status=503 bytes= protocol=https
2021-08-31T11:17:32.247223+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=web-facebock.herokuapp.com request_id=d15e7971-6164-4dec-b761-0fd33b075dc4 fwd="197.210.76.123" dyno= connect= service= status=503 bytes= protocol=https```

【问题讨论】:

  • 你能提供一些代码吗? pkg.json 开始
  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: javascript node.js mongodb express


【解决方案1】:

您的 package.json 需要包含:

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

Start script missing error when running npm start

这个问题得到了类似的回答,提供了更多细节。

【讨论】:

    猜你喜欢
    • 2021-05-02
    • 2015-11-20
    • 2014-12-13
    • 2020-10-05
    • 2021-03-14
    • 2011-12-26
    • 2018-01-27
    • 2022-01-14
    • 1970-01-01
    相关资源
    最近更新 更多