Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Having errors deploying Node server to heroku

I am deploying my Node Express server to heroku, and I have some error after I do git push heroku master. I am complete beginner to deploying apps to heroku. How do I fix this error?

What I have tried:

  • I have set process.env.PORT.
  • Adding a Procfile with web:node index.js in it
  • heroku restart
2021-11-27T02:39:05.410712+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=logo-eshop.herokuapp.com request_id=fb4f6e95-de99-4135-9273-789af704557d fwd="79.66.155.39" dyno= connect= service= status=503 bytes= protocol=https        
2021-11-27T02:39:05.650439+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=logo-eshop.herokuapp.com request_id=6572c3a7-f7c4-4ef6-ae09-cd4fcf0c6f5f fwd="79.66.155.39" dyno= connect= service= status=503 bytes= protocol=https

Also, I have fixed the nodemon in my package.json:

"scripts": {
   "start": "node index.js"
}

But I still have the error.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It actually looks like its because nodemon is not found.

Nodemon should not be used in production or deployment, since you dont need/want to auto refresh your server in your production env.

To prevent this, simply add another field in your scripts section of your package.json file, and remove nodemon from "start". It should look similar to this:

"scripts": {
    "start": "index.js",
    "dev": "nodemon index.js"
  },

Now, when developing in your own machine, instead of calling npm start (or yarn start), call npm run dev (yarn run dev).

That way, heroku will never try to use nodemon during production and deployment, but you will be able to auto restart your server during development

Heroku will call npm start, and so if a nodemon command is here, it will fail.

about 4 years ago · Juan Pablo Isaza Report

0

I found the solution. For those who may have the same problem with me, I simply add all my env variables in Heroku (Setting > Config Vars).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!