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

647
Vistas
Why NPM is working locally but not on Docker?

I'm on Windows 10

I'm on a new project and I can't use npm install and npm audit fix on docker-compose up -d, so it's stuck on the first npm install

NPM is working locally with my configured proxy :

npm config set proxy http://proxy.company.com:8080

npm config set https-proxy http://proxy.company.com:8080

I tried to configure docker proxy, windows proxy and npm proxy, and to npm install manually folder and it's working without docker

I tried on Linux and on other computer too, and it's not working too

Node version is : v10.15.0

Npm version is : 6.9.0

npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://registry.npmjs.org/cors failed, reason: connect ECONNREFUSED ip.ip.ip.ip:443
npm ERR!     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:196:13)
...

I can provide the full error

I think it's a proxy problem but I can't understand why and how I can try something else

On another network I can docker-compose up -d without any problems

E: I tried without results :

ENV HTTP_PROXY "http://proxy.company.com:8080"

and configure .docker/config.json

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

http://proxy.company.com:8080

could not resolved by your docker network.you should run your docker with the same network interface as your host machine by passing --network host to your docker run command

over 4 years ago · Santiago Trujillo Denunciar

0

I had to configure container proxy with a JSON file /.docker/config.json like :

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://username:password@PROXY_IP:port",
     "httpsProxy": "http://username:password@PROXY_IP:port",
     "noProxy": "noproxiesinformation"
   }
 }
}

So configure Docker proxy and Docker container proxy and it's working

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