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

489
Visualizações
AWS Elastic Beanstalk Docker Node Typescript Entry point not found

I have an EBS Instance with Platform Docker running on 64bit Amazon Linux/2.16.5

I have a nodejs typescript app which when uploaded needs to be compiled then run.

I get this error in /var/log/eb-docker/containers/eb-current-app/unexpected-quit.log after downloading full logs.

Docker container quit unexpectedly on Thu Mar 11 02:12:43 UTC 2021:

> mybackend@1.0.0 start /usr/src/app
> node ./dist/server.js

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/usr/src/app/dist/server.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mybackend@1.0.0 start: `node ./dist/server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mybackend@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-03-11T02_12_39_040Z-debug.log

Dockerfile

FROM node:14-alpine

WORKDIR /usr/src/app
COPY package*.json ./

RUN npm install
COPY tsconfig*.json ./
COPY src src
RUN npm run build

ENV NODE_ENV=ebs
ENV PORT=8080
ENV HOST=0.0.0.0
EXPOSE 8080
ENTRYPOINT ["npm", "start"]

package.json scripts

"scripts": {
    "start": "node ./dist/server.js",
    "build": "tsc",
    "dev": "nodemon",
    "test": "jest --watch"
  },

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "outDir": "dist",
    "sourceMap": true,
    "strict": true,
    "target": "es2017",
    "allowSyntheticDefaultImports": true,
    "noImplicitAny": false
  },
  "compileOnSave": true,
  "include": [
    "src/",
  ]
}

This works fine locally on my ubuntu machine using docker. It only fails on ebs instance.

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