我遇到一个问题,即模块npm-check不能正常工作,因为连接已超时。我在公司代理后面。
当我运行npm doctor
时,它告诉我它无法连接到104.20.22.46:443
,并且我应该正确配置代理...这已经做了,因为npm install
可以工作很好,当我的代理设置错误或密码过时时,该功能将无法正常工作。
0 info it worked if it ends with ok
1 verbose cli [ 'E:\\Archivos de Programa\\node\\node.exe',
1 verbose cli 'F:\\Users\\EIT5488\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'doctor' ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 info doctor Running checkup
5 info checkPing Pinging registry
6 verbose request uri https://registry.npmjs.org/-/ping?write=true
7 verbose request no auth needed
8 info attempt registry request try #1 at 16:42:53
9 verbose request id 392537f08c8f2bde
10 http request GET https://registry.npmjs.org/-/ping?write=true
11 http 200 https://registry.npmjs.org/-/ping?write=true
12 verbose headers { date: 'Thu, 10 Jan 2019 15:42:54 GMT',
12 verbose headers 'content-type': 'application/json',
12 verbose headers 'transfer-encoding': 'chunked',
12 verbose headers connection: 'close',
12 verbose headers 'set-cookie':
12 verbose headers [ '__cfduid=d9ec3f425bb2aededb5ca99d4d5a4d3e71547134974; expires=Fri, 10-Jan-20 15:42:54 GMT; path=/; domain=.registry.npmjs.org; HttpOnly' ],
12 verbose headers 'content-encoding': 'gzip',
12 verbose headers 'cf-ray': '49704195a97b693e-CDG',
12 verbose headers 'expect-ct':
12 verbose headers 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
12 verbose headers vary: 'Accept-Encoding',
12 verbose headers server: 'cloudflare' }
13 info getLatestNpmVersion Getting npm package information
14 verbose npm-session 04a335cf6e5b12a3
15 http fetch GET 304 https://registry.npmjs.org/npm 166ms (from cache)
16 silly pacote tag manifest for npm@latest fetched in 239ms
17 info getLatestNodejsVersion Getting Node.js release information
18 verbose stack Error: connect ETIMEDOUT 104.20.22.46:443
18 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
19 verbose cwd F:\JAVA\ghe\myproject
20 verbose Windows_NT 6.1.7601
21 verbose argv "E:\\Archivos de Programa\\node\\node.exe" "F:\\Users\\EIT5488\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "doctor"
22 verbose node v10.13.0
23 verbose npm v6.4.1
24 error code ETIMEDOUT
25 error errno ETIMEDOUT
26 error syscall connect
27 error network connect ETIMEDOUT 104.20.22.46:443
28 error network This is a problem related to network connectivity.
28 error network In most cases you are behind a proxy or have bad network settings.
28 error network
28 error network If you are behind a proxy, please make sure that the
28 error network 'proxy' config is set properly. See: 'npm help config'
29 verbose exit [ 1, true ]
这是npm config list
的部分输出:
; userconfig F:\Users\EIT5488\.npmrc
http-proxy = "http://eit5488:superStrongPassword@hostname-of-the-proxy:80"
https-proxy = "http://eit5488:superStrongPassword@hostname-of-the-proxy:80/"
proxy = "http://eit5488:superStrongPassword@hostname-of-the-proxy:80/"
registry = "https://registry.npmjs.org/"
strict-ssl = false
除此之外,npm可以工作...