简体   繁体   English

我在将Node应用程序部署到Heroku时遇到问题,我在哪里出错?

[英]I am having trouble deploying a Node app to Heroku, where am I going wrong?

I keep trying to push my code but hit a brick wall and have a page which gives me an application error and tells me to check the logs. 我一直在尝试推送我的代码,但是碰到一堵墙,有一个页面,该页面给我一个应用程序错误,并告诉我检查日志。

I am unsure of what to do next. 我不确定下一步该怎么做。

I can provide the git repo address if that helps. 如果有帮助,我可以提供git repo地址。

Thank you ! 谢谢 !

There are a few things to check for when deployment fails on Heroku. 在Heroku上部署失败时,需要检查几件事。

Have you... 你有...

  1. Made a procfile on the root folder? 在根文件夹上制作了一个procfile It's usually a simple one-line file that tells it to run the server. 它通常是一个简单的单行文件,告诉它运行服务器。

     web: node server/server.js 
  2. Included necessary modules in your package.json file? package.json文件中包含必要的模块吗?

  3. Does your server need to connect to a DB? 您的服务器需要连接到数据库吗? If so, logs should tell you something like database connection failed. 如果是这样,日志应该告诉您类似数据库连接失败的信息。

Please refer to the Heroku docs for more info. 请参阅Heroku文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM