2 t2045817161 t2045817161 于 2017.09.01 13:05 提问

npm ETIMEDOUT nodej安装第三方模块老是报错

C:\Users\v_xbingtan>npm install -g xml2js
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npm.taobao.org/xml2js failed, reason: connect ETIMEDOU
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\v_xbingtan\AppData\Roaming\npm-cache_logs\2017-09-01T02_41_59_830Z-debug.log

那些什么更换registry ,设置代理为null等都试过了,还是这样。到底是什么原因,如何去解决呢

日志里看不出什么 来,以下是日志文件:
0 info it worked if it ends with ok
1 verbose cli [ 'F:\develop\nodejs\node.exe',
1 verbose cli 'F:\develop\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'xml2js' ]
2 info using npm@5.3.0
3 info using node@v8.4.0
4 verbose npm-session 2e9c8d90d22e4948
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for xml2js@latest request to https://registry.npm.taobao.org/xml2js failed, reason: connect ETIMEDOUT 114.55.80.225:443
8 verbose type system
9 verbose stack FetchError: request to https://registry.npm.taobao.org/xml2js failed, reason: connect ETIMEDOUT 114.55.80.225:443
9 verbose stack at ClientRequest.req.on.err (F:\develop\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
9 verbose stack at emitOne (events.js:115:13)
9 verbose stack at ClientRequest.emit (events.js:210:7)
9 verbose stack at TLSSocket.socketErrorListener (_http_client.js:401:9)
9 verbose stack at emitOne (events.js:115:13)
9 verbose stack at TLSSocket.emit (events.js:210:7)
9 verbose stack at emitErrorNT (internal/streams/destroy.js:64:8)
9 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11)
9 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9)
10 verbose cwd C:\Users\v_xbingtan
11 verbose Windows_NT 6.1.7601
12 verbose argv "F:\develop\nodejs\node.exe" "F:\develop\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "xml2js"
13 verbose node v8.4.0
14 verbose npm v5.3.0
15 error code ETIMEDOUT
16 error errno ETIMEDOUT
17 error network request to https://registry.npm.taobao.org/xml2js failed, reason: connect ETIMEDOUT 114.55.80.225:443
18 error network This is a problem related to network connectivity.
18 error network In most cases you are behind a proxy or have bad network settings.
18 error network
18 error network If you are behind a proxy, please make sure that the
18 error network 'proxy' config is set properly. See: 'npm help config'
19 verbose exit [ 1, true ]

1个回答

zy841958835
zy841958835   Ds   Rxr 2017.09.01 14:41

npm install -g npm 更新下试试

zy841958835
zy841958835 mac 还是windows mac的话看下brew行不行 windows看下ping外网 不行的话 可能要设置代理 设置之后得生效
3 个月之前 回复
t2045817161
t2045817161 都试过了 还是不行 都搞了一两个礼拜了 只要是npm install 都不行
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片