将应用程序部署到Heroku时出错

编程入门 行业动态 更新时间:2024-10-18 12:31:26
本文介绍了将应用程序部署到Heroku时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用git hub将我的应用部署到heroku时,出现某种错误。问题是,我不明白heroku日志和错误。这里是heroku日志:

I am getting some kind of error when deploying my app to heroku using git hub. The problem is, I don't understand the heroku logs and the entailing errors. Here is the heroku log:

Marcuss-MacBook-Pro:Weather-App marcushurney$ heroku logs 2016-01-05T14:37:27.798077+00:00 app[web.1]: npm ERR! Please include the following file with any support request: 2016-01-05T14:37:27.798377+00:00 app[web.1]: npm ERR! /app/npm-debug.log 2016-01-05T14:37:27.786949+00:00 app[web.1]: npm ERR! node v5.1.1 2016-01-05T14:37:27.786556+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start" 2016-01-05T14:37:27.787856+00:00 app[web.1]: npm ERR! npm v3.3.12 2016-01-05T14:37:28.776245+00:00 heroku[web.1]: Process exited with status 1 2016-01-05T14:37:28.789412+00:00 heroku[web.1]: State changed from starting to crashed 2016-01-05T17:27:16.684869+00:00 heroku[web.1]: State changed from crashed to starting 2016-01-05T17:27:17.853743+00:00 heroku[web.1]: Starting process with command `npm start` 2016-01-05T17:27:20.423495+00:00 app[web.1]: npm ERR! node v5.1.1 2016-01-05T17:27:20.423130+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start" 2016-01-05T17:27:20.424111+00:00 app[web.1]: npm ERR! npm v3.3.12 2016-01-05T17:27:20.425937+00:00 app[web.1]: npm ERR! missing script: start 2016-01-05T17:27:20.422441+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic 2016-01-05T17:27:20.426242+00:00 app[web.1]: npm ERR! 2016-01-05T17:27:20.426432+00:00 app[web.1]: npm ERR! If you need help, you may report this error at: 2016-01-05T17:27:20.426634+00:00 app[web.1]: npm ERR! <github/npm/npm/issues>

推荐答案

您必须通知heroku从哪里开始:缺少脚本:start 。在你的package.json中,你应该有一些像这个:

You have to inform heroku where to start : missing script: start. In your package.json, you should have something like this:

"scripts": { "start": "node index.js" }

其中 index.js 是您的入口点。

作为 Procfile 中指定:

web: node index.js

更多推荐

将应用程序部署到Heroku时出错

本文发布于:2023-11-08 07:29:32,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   Heroku

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!