简体   繁体   English

Node.js 应用程序未在 Heroku 上正确部署

[英]Node.js app not deploying correctly on Heroku

My repository: https://github.com/jacklemasters/tech-blog我的存储库: https://github.com/jacklemasters/tech-blog

The app works locally on my machine, but I cannot seem to figure out why it will not work on Heroku. I have attempted completely moving the code, a new repository, nothing seems to help.该应用程序在我的机器上本地运行,但我似乎无法弄清楚为什么它不能在 Heroku 上运行。我尝试完全移动代码,一个新的存储库,似乎没有任何帮助。

Here are the error logs I am receiving from Heroku: 2021-10-04T14:32:52.833339+00:00 app[web.1]: npm ERR.这是我从 Heroku 收到的错误日志:2021-10-04T14:32:52.833339+00:00 app[web.1]: npm ERR。 tech-blog@1.0:0 start. tech-blog@1.0:0 开始。 node server:js 2021-10-04T14:32.52:833414+00.00 app[web:1]: npm ERR: Exit status 1 2021-10-04T14.32:52.833484+00:00 app[web:1]: npm ERR.节点服务器:js 2021-10-04T14:32.52:833414+00.00 app[web:1]: npm ERR: 退出状态 1 2021-10-04T14.32:52.833484+00:00 app[web:1]: npm ERR . 2021-10-04T14:32.52:833533+00.00 app[web.1]. 2021-10-04T14:32.52:833533+00.00 应用 [web.1]。 npm ERR: Failed at the tech-blog@1:0.0 start script: 2021-10-04T14.32:52.833601+00.00 app[web:1]: npm ERR. npm ERR:在 tech-blog@1:0.0 启动脚本失败:2021-10-04T14.32:52.833601+00.00 app[web:1]: npm ERR。 This is probably not a problem with npm: There is likely additional logging output above.这可能不是 npm 的问题:上面可能有其他日志记录 output。 2021-10-04T14:32:52:847732+00.00 app[web:1]. 2021-10-04T14:32:52:847732+00.00 应用 [web:1]。 2021-10-04T14:32:52:847831+00:00 app[web.1]: npm ERR. 2021-10-04T14:32:52:847831+00:00 app[web.1]: npm 错误。 A complete log of this run can be found in: 2021-10-04T14.32.52:847916+00:00 app[web.1]: npm ERR.可以在以下位置找到此运行的完整日志:2021-10-04T14.32.52:847916+00:00 app[web.1]: npm ERR。 /app/:npm/_logs/2021-10-04T14_32_52_834Z-debug:log 2021-10-04T14:32.53:006395+00.00 heroku[web:1]: Process exited with status 1 2021-10-04T14:32:53.089213+00:00 heroku[web.1]: State changed from starting to crashed /app/:npm/_logs/2021-10-04T14_32_52_834Z-debug:log 2021-10-04T14:32.53:006395+00.00 heroku[web:1]: 进程以状态 1 2021-10-04T14:32:53.089213+ 退出00:00 heroku[web.1]: State 从开始变为崩溃

edit: I understand it could be something with my packages, but on my side I see them as installed.编辑:我知道这可能与我的包裹有关,但在我这边,我看到它们已安装。 Still at a loss!还是亏了!

You are using libraries that you didn't import into the package.json with npm.您正在使用未导入 package.json 和 npm 的库。

Example: npm install express-session示例: npm install express-session

Other thing that is wrong is to upload the.dotenv file to GitHub. Use the.gitignore to avoid it and configure the heroku envorinment variables.另一个错误是将 .dotenv 文件上传到 GitHub。使用 .gitignore 来避免它并配置 heroku envorinment 变量。 See more here: https://devcenter.heroku.com/articles/config-vars在此处查看更多信息: https://devcenter.heroku.com/articles/config-vars

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

相关问题 无法将Node.js应用程序部署到heroku - Trouble deploying Node.js app to heroku 在 Heroku 上部署 Node.js 应用程序时出现 403 错误 - 403 error when deploying a Node.js app on Heroku 使用Heroku部署Node.js应用程序时公共目录的问题 - Problems with public directory when deploying Node.js app with Heroku 部署 Node.js/React 应用程序时 Heroku 构建失败 - Heroku build failure when deploying Node.js/React app 将Node.js应用程序部署到Heroku时出现“ ReferenceError:未定义压缩” - “ReferenceError: compression is not defined” when deploying Node.js app to Heroku 将node.js应用程序部署到Heroku-“未找到gruntfile”。 - Deploying node.js app to Heroku - “No gruntfile found.” 带有节点的离子应用程序未在 Heroku 上正确部署 - Ionic app with node not deploying correctly on Heroku 将Aurelia.js + io.js / node.js应用程序部署到heroku Github速率限制问题 - Deploying Aurelia.js + io.js/node.js app to heroku Github rate limit problems 将Node.js应用程序部署到heroku时发生Async.times错误(重复循环) - Async.times error when deploying Node.js app to heroku (repeated loop) 在Heroku上部署Node.js,express,knex应用-未处理的拒绝错误:池已损坏 - Deploying Node.js, express, knex app on Heroku - Unhandled rejection Error: Pool is destroyed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM