First, post the error: here is my error log:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\nodejs\\node.exe',
1 verbose cli 'D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'cnpm',
1 verbose cli '--registry=https://registry.npm.taobao.org' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 026191e276c3f621
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for cnpm@latest request to https://registry.npm.taobao.org/cnpm failed, reason: connect ETIMEDOUT 93.184.216.34:8080
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 133469ms
10 verbose type system
11 verbose stack FetchError: request to https://registry.npm.taobao.org/cnpm failed, reason: connect ETIMEDOUT 93.184.216.34:8080
11 verbose stack at ClientRequest.req.on.err (D:\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
11 verbose stack at ClientRequest.emit (events.js:189:13)
11 verbose stack at onerror (D:\nodejs\node_modules\npm\node_modules\agent-base\index.js:100:9)
11 verbose stack at callbackError (D:\nodejs\node_modules\npm\node_modules\agent-base\index.js:122:5)
11 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
12 verbose cwd C:\Users\Administrator.L6BFMF7743P5SU1
13 verbose Windows_NT 10.0.17763
14 verbose argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org"
15 verbose node v10.15.3
16 verbose npm v6.4.1
17 error code ETIMEDOUT
18 error errno ETIMEDOUT
19 error network request to https://registry.npm.taobao.org/cnpm failed, reason: connect ETIMEDOUT 93.184.216.34:8080
20 error network This is a problem related to network connectivity.
20 error network In most cases you are behind a proxy or have bad network settings.
20 error network
20 error network If you are behind a proxy, please make sure that the
20 error network 'proxy' config is set properly. See: 'npm help config'
21 verbose exit [ 1, true ]
Installed many times, are the same error, the installation of online solutions to try a lot of unresolved. Later, according to the log, it was found that it was the agent setting problem.
At first, I thought that the Taobao agent was not effective. Later, when I installed cnpm, I found the same problem, but it was not the problem of Taobao setting.
Note the proxy address printed in the log: 93.184.216.34:8080.
Solution: set the above address and port as proxy
Step one:
npm config set prefix "D:\nodejs\node_global"
Step 2:
npm config set cache "D:\nodejs\node_cache"
Step 3:
npm config set proxy 93.184.216.34:8080
Step 4:
npm config set https-proxy 93.184.216.34:8080
last:
npm install -g cnpm --registry=https://registry.npm.taobao.org
After the above execution, you can enter: cnpm – V to test
Refer to node for specific installation process . JS installation and cnpm configuration
Reference article: NPM and cnpm (Windows) installation steps
npm ERR ! network connect ETIMEDOUT
div>
Read More:
- Cnpm appears in the vscode terminal: unable to load the file C: \ “users \” gkk \ “appdata \” roaming \ “NPM \” cnpm
- Solution to node sass installation failure
- Simple solution for node sass installation failure
- Solution / error of. Net framework 4.0 installation failure HResult 0xc8000222 solution
- Solution to CUDA installation failure problem visual studio integration failed
- Solution for AutoCAD 2020 installation failure (error code: 1603) / valid for Autodesk family products
- NPM can’t find D: //nodejs/node all of The solution of sudden_modules/NPM/bin/npm-cli.js
- Unloading and installation of node and NPM of Vue Foundation
- NPM installs dependent packages and reports an error node gyp rebuild… Solution
- NPM installation module encountered enoent: no such file or directory, rename error
- Command failed: NPM install — loglevel error — registry= https://registry.npm.taobao.org
- Non 7z achieve. Error reported during CUDA installation. Solution: the installation file is damaged
- Go: How to Fix plug-in installation failure in vscode of windows system
- The solution of NPM err! Code elifecycle
- Solve the problem of failure in installation of golang plug-in dependency in vscode
- NPM run build error solution
- Solution of NPM err! Code elifecycle
- Vscode cnpm: unable to load file, but open console with CMD without error
- Solution of visdom startup failure in Windows 10
- Android installation failure: install_ FAILED_ NO_ MATCHING_ ABIS: Failed to extract native libraries, res=-113.