0

I tried multiple ways to fix this issue (add/ modify Procfile, modify package.json...) but still not able to fix it. It would be appreciated if you can give me a hand, thanks in advance.

Here is the Heroku log:

enter image description here

Here is Github:

https://github.com/rainpaul/mern-family

add/ modify Procfile, modify package.json

After set Procfile to web: npm start, received new Heroku logs:

enter image description here

UPDATE: Now I get new error, please help:

enter image description here

  • It seems you have a typo. Your file is `backend/server.js` yet your `Procfile` is `node servers.js` (notice the plural). – acdcjunior Nov 03 '22 at 03:39
  • Welcome to Stack Overflow. [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied, or even consumed by users of adaptive technologies like screen readers. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. – ChrisGPT was on strike Nov 03 '22 at 12:19

1 Answers1

0

Try running the script you have defined in your package.json from your Procfile:

web: npm start

I noticed that you defined certain versions for Heroku to run for node and npm, are those the same versions you are running locally? I have had luck in the past by setting these greater than or equal to the version I wanted:

  "engines": {
    "node": ">=14.17.4"
    "npm": ">=6.14.14"
   }
lexabu
  • 11
  • 3
  • Hi Lexabu, thanks for your answer, I tried your suggestion for "web: npm start" and now received new Heroku logs, let me find out how to post it here in StackOverFlow. Just updated on my post. – Xuan Khang Huynh Nov 03 '22 at 04:02
  • Checkout this thread as well based on your log errors: https://stackoverflow.com/questions/22618930/heroku-failing-to-start-my-node-app-because-its-trying-to-do-it-with-nodemon – lexabu Nov 03 '22 at 04:29
  • 1
    In production or in deployment you shouldn't be using nodemon. – lexabu Nov 03 '22 at 04:32