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

454
Visualizações
Elastic Beanstalk: Deploy Nodejs status Degraded Following services are not running: web

I just use eb deploy and also tried upload with zip, the elatic beanstalk environment show "degraded".

The log when I click in to see is

Overall 
Degraded

Impaired services on all instances.

Severe
Following services are not running: web.

My app.js file:

const express = require('express');
const app = express();

app.listen(3000, () => {
    console.log("Sever console log.")
});

package.json content

{
  "name": "project_api",
  "version": "1.0.0",
  "engines": {
    "node": "12.18.3"
  },
  "description": "the server side of the api",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Businsoft Limited",
  "license": "ISC",
  "dependencies": {
    "dropbox": "^5.2.1",
    "express": "^4.17.1",
    "isomorphic-fetch": "^2.2.1",
    "nodemon": "^2.0.4"
  }
}

I think this is the simpliest start with Elastic Beanstalk, but somehow it fails. Any idea to solve it?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

After debug for a while, I managed to figure out the issue.

In package.json

I need to remove this line:

"main": "app.js",

And the add the "start" in the "scripts" like this:

"scripts":
  "start": "node app.js"

And then update the

app.listen(3000, () => {
    console.log("Sever console log.")
});

to

const port = process.env.port || 3000;
app.listen(port, () => {
    console.log("Sever console log.")
});

And then go to AWS Console > Elastic Beanstalk's environment > Configuration > Software Edit > add a properties at Environment properties

Name port Value 8080

Finally reupload the source code, and it works.

over 4 years ago · Santiago Trujillo 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