0

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! [email protected] 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 [email protected] 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!

1

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

4 Comments

this would make sense considering I kept moving the files and reinstalling. Is there a difference between just writing npm install express-session with and without the --save? I only ask because I had never seen that before. I will be home to try this in a few hours and let you know if it worked. Thank you so much for the answer.
Your welcome. Try to reinstall all your packages using npm and make sure that they are imported into the package.json. About the --save, your are right, is no longer needed afer npm version 5.0.0. It was needed to inject the module into the package in the past.
I finally had the attempt to try this, and still getting the same error. Is there something I am missing? I see the dependencies on my package.json.. Tried installing them once again anyways, still running into the same issue!
Should have added.. Here are new errors. imgur.com/a/mj2tMuA

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.