【发布时间】:2019-05-21 14:00:10
【问题描述】:
我使用的是 Windows 10
我在一个新项目上,我不能在docker-compose up -d 上使用npm install 和npm audit fix,所以它卡在第一个npm install 上
NPM 正在本地使用我配置的代理:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
我尝试配置 docker 代理、windows 代理和 npm 代理,并手动安装 npm 文件夹,它在没有 docker 的情况下工作
我在 Linux 和其他计算机上也试过了,但它也不工作
节点版本为:v10.15.0
Npm 版本是: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)
...
我可以提供完整的错误
我认为这是代理问题,但我不明白为什么以及如何尝试其他方法
在另一个网络上我可以docker-compose up -d 没有任何问题
E:我试过没有结果:
ENV HTTP_PROXY "http://proxy.company.com:8080"
并配置.docker/config.json
【问题讨论】:
-
你可以通过 docker 容器联系外界(例如:ping/curl)吗?
-
不,我无法在 Docker 和本地 ping registry.npmjs.org,我猜它被系统管理员阻止了,我只是无法在 Windows 命令提示符上 ping