Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

448
Vistas
Docker build cannot find javascript modules (Docker/Nodejs/Express)

I'm building Express using Docker.

Previously, I uploaded it to the Ubuntu server using the Dockerfile. But suddenly there was an error. When building Docker Image, there was an error that could not read the file. When I build with Docker and run, It can't find the javascript module I made.

An error occurred even if dockerfile2 was used instead of dockerfile1.

I don't know what the problem is.

I updated Docker, too.

Docker version 20.10.8,


Error Msg.
(when use dockerfile1) Error msg : Cannot find module

Error Msg.
(when use dockerfile2)

> socket_example@1.0.0 start /usr/src/app
> node app.js

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

Error: Cannot find module './AgoraApi'
Require stack:
- /usr/src/app/src/audioChat/audioChannelHandler.js
- /usr/src/app/src/multiplay/rooms/GameRoom.js
- /usr/src/app/app.js

docker file1

FROM node:14
WORKDIR /
COPY  package.json ./
RUN  npm install
COPY  ./ ./
EXPOSE 4000
CMD [ "npm", "start" ]

docker file2

FROM node:14
WORKDIR /usr/src/app
COPY  package.json /usr/src/app
RUN  npm install
COPY  . /usr/src/app
EXPOSE 4000
CMD [ "npm", "start" ]

dockerignore file

.git
.gitignore

README.md
webpack.config.js
NAF-Gallery-Test.git
package-lock.json
backup
logs

node_modules
config/sql/*

!src
!util

Folder Structure

app.js
config.js
src
ㄴaudioChat
 ㄴagoraApi.js
util
ㄴvipRoomManager.js
...
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda