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

639
Views
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 answers
Answer question

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 Report

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 Report
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!