通过终端运行Heroku没有成功

时间:2016-04-16 08:23:16

标签: node.js web-services heroku

我正在尝试通过终端运行我在Heroku上创建的应用程序并将我的代码推送到Heroku但是当我尝试运行并且我的浏览器启动时出现此错误:

“应用程序出错,无法提供您的网页。请稍后再试。

如果您是应用程序所有者,请查看日志以获取详细信息。“

在Heroku日志中我得到了这个:

2016-04-16T08:06:37.028300+00:00 heroku[api]: Enable Logplex by tommyahav@gmail.com
2016-04-16T08:06:37.028300+00:00 heroku[api]: Release v2 created by tommyahav@gmail.com
2016-04-16T08:11:17.934258+00:00 heroku[api]: Scale to web=1 by tommyahav@gmail.com
2016-04-16T08:11:17.998349+00:00 heroku[api]: Deploy d49f451 by tommyahav@gmail.com
2016-04-16T08:11:17.998349+00:00 heroku[api]: Release v3 created by tommyahav@gmail.com
2016-04-16T08:11:18.444546+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-16T08:11:18.444556+00:00 heroku[slug-compiler]: Slug compilation finished
2016-04-16T08:11:20.996842+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-16T08:11:24.058359+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-16T08:11:24.071525+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-16T08:11:24.075928+00:00 app[web.1]: npm ERR! node v5.10.0
2016-04-16T08:11:24.077165+00:00 app[web.1]: npm ERR! npm  v3.8.3
2016-04-16T08:11:24.104687+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-04-16T08:11:24.104275+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-04-16T08:11:24.126366+00:00 app[web.1]: 
2016-04-16T08:11:24.103431+00:00 app[web.1]: npm ERR! missing script: start
2016-04-16T08:11:24.126822+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-16T08:11:24.127038+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-04-16T08:11:24.094153+00:00 app[web.1]: 
2016-04-16T08:11:24.104022+00:00 app[web.1]: npm ERR! 
2016-04-16T08:11:25.136368+00:00 heroku[web.1]: Process exited with status 1
2016-04-16T08:11:25.157435+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-16T08:11:25.156030+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-16T08:11:26.642881+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-16T08:11:29.940545+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-16T08:11:29.941387+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-16T08:11:29.941913+00:00 app[web.1]: npm ERR! node v5.10.0
2016-04-16T08:11:29.942627+00:00 app[web.1]: npm ERR! npm  v3.8.3
2016-04-16T08:11:29.944449+00:00 app[web.1]: 
2016-04-16T08:11:29.945912+00:00 app[web.1]: npm ERR! missing script: start
2016-04-16T08:11:29.946108+00:00 app[web.1]: npm ERR! 
2016-04-16T08:11:29.946249+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-04-16T08:11:29.946394+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-04-16T08:11:29.979159+00:00 app[web.1]: 
2016-04-16T08:11:29.979436+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-16T08:11:29.979573+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-04-16T08:11:31.099494+00:00 heroku[web.1]: Process exited with status 1
2016-04-16T08:11:31.111785+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-16T08:11:41.679507+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=targil0.herokuapp.com request_id=b0e6c517-19bf-4fe9-b2ae-10a66a8531b7 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:11:42.011245+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=targil0.herokuapp.com request_id=5d888504-10b6-494c-97ba-300363c40ea8 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:33.276559+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=targil0.herokuapp.com request_id=a3bbb3d2-1b15-428f-8bc9-c084820d07b3 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:33.719142+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=targil0.herokuapp.com request_id=80f9fca8-8edd-40f1-876e-fd0d7c4629e8 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:34.583904+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=targil0.herokuapp.com request_id=f05e3322-020e-402a-abaf-3066b70f7524 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:35.024463+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=targil0.herokuapp.com request_id=abe440c1-e342-42c3-be8e-66534a27b9ed fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:56.404658+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=targil0.herokuapp.com request_id=6fa70ad5-bf10-4eb0-b3c6-e449a90ffadf fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:12:56.750374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=targil0.herokuapp.com request_id=c188c52c-6117-4bcf-878c-a85892230160 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:13:44.397134+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=targil0.herokuapp.com request_id=9b61b821-4e3f-411f-89b0-2e8d50fdbc80 fwd="79.183.166.1" dyno= connect= service= status=503 bytes=
2016-04-16T08:13:44.741220+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=targil0.herokuapp.com request_id=ff9b279c-6c23-4abc-bf9d-1b8f09964d5f fwd="79.183.166.1" dyno= connect= service= status=503 bytes=

请帮助我,告诉我做错了什么。

谢谢,

1 个答案:

答案 0 :(得分:0)

重要的部分是:

argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
missing script: start

Heroku抱怨它无法找到您要发布的脚本。

请打印您的Procfile以及index.jspackage.json等脚本,具体取决于您的Procfile所说的内容。

如果您没有向项目根目录添加Procfile,则会使用默认的npm start,因此您需要"scripts.start"文件中的package.json属性。所以请打印出来:))

您可以查看处理Node部署的Heroku指南(Getting startedSupport)。