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

648
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
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