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

208
Vistas
Node.js docker can't install npm dependencies

I have this Dockerfile

FROM node:14

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD [ "node", "app.mjs" ]

And I can successfully run

docker run hello-world

on my ubuntu 20.10 OS. So I am assuming that docker is installed successfully. But when I tried to run

docker build .

It gives me this error

enter image description here

This is not something with the npm. I can locally install the dependencies without any issue. I assume Dokcer can't access npm registry to pull the npm packages. Something to do with networks I guess.

How do I fix this issue?

This is my code https://github.com/Enuri-Information-Systems/docker-test

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Depending on the network configuration it could happen that you run into problems that the container is not able to connect to a server to download data. This can have various reasons and also depends on how you run docker.

One common thing is that your network requires the usage of a proxy. But only having the error message it is not possible to tell what the exact reason in your case is.

One solution to that problem is to specify the network mode. Adding --network host as an option should most of the time work.

So running your build command that way docker build --network=host . should work.

about 4 years ago · Juan Pablo Isaza Denunciar
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