Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda