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 [email protected] request to https://registry.npm.taobao.org/cnpm failed, reason: connect ETIMEDOUT 188.8.131.52: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 184.108.40.206: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 220.127.116.11: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: 18.104.22.168:8080.
Solution: set the above address and port as proxy
npm config set prefix "D:\nodejs\node_global"
npm config set cache "D:\nodejs\node_cache"
npm config set proxy 22.214.171.124:8080
npm config set https-proxy 126.96.36.199:8080
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
- 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.