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

156
Views
No se puede encontrar el módulo '/home/backend/dist/src/server.js' con Docker

Muy nuevo en Docker, pero cuando intento ejecutar el contenedor después de compilarlo, aparece el siguiente error, ¿alguien se ha topado con esto antes?

 'internal/modules/cjs/loader.js:905 throw err;' ^ 'Error: Cannot find module '/home/backend/dist/src/server.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []'

Lo he construido sin la ventana acoplable y parece funcionar bien. Ejecuto los siguientes comandos contra el archivo acoplable (a continuación):

docker build -t [name] .

docker run [name]

 FROM node:14.17.1 as base WORKDIR /home/backend //Add package file COPY package.json ./ COPY yarn.lock ./ //Install deps RUN yarn install //Copy source COPY src ./src COPY tsconfig.json ./tsconfig.json //Build dist RUN yarn build //Start production image build FROM gcr.io/distroless/nodejs:14 //Copy node modules and build directory COPY --from=base /home/backend/dist ./home/backend/dist //Expose port 5000 EXPOSE 5000 CMD [ "/home/backend/dist/src/server.js" ]
about 4 years ago · Juan Pablo Isaza
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!