简体   繁体   中英

Node.js app not deploying correctly on Heroku

My repository: 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.

Here are the error logs I am receiving from Heroku: 2021-10-04T14:32:52.833339+00:00 app[web.1]: npm ERR. tech-blog@1.0:0 start. 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. 2021-10-04T14:32.52:833533+00.00 app[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. This is probably not a problem with npm: There is likely additional logging output above. 2021-10-04T14:32:52:847732+00.00 app[web:1]. 2021-10-04T14:32:52:847831+00:00 app[web.1]: npm ERR. A complete log of this run can be found in: 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

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.

Example: 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. See more here: https://devcenter.heroku.com/articles/config-vars

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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