使用npm安装任何包,安装半天进度条一动不动最后超时错误
使用npm安装任何包,安装半天进度条一动不动最后超时错误。
npm install nrm -g
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npm.taobao.org/jsprim failed, reason: connect ETIMEDOUT 36.158.205.19:443
npm ERR! network This is a problem related to network connectivity.
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! D:\my_apps\nodeJS\node_cache_logs\2022-04-18T06_53_14_782Z-debug-0.log
查来查去node都换了几个版本,path路径,npm配置都没用。结果一切的原因只是淘宝镜像换了新域名……
直接搜索报错信息,排在前列的一切解决方法都是用的旧域名,导致始终解决不了问题。
淘宝镜像现官网:http://www.npmmirror.com/
终端输入:
npm config set registry https://registry.npmmirror.com/
然后找到 /Users/你的计算机名/.npmrc文件(隐藏文件)
// 这一行前面加#
#proxy=http://127.0.0.1:7890/
registry=https://registry.npmmirror.com/
https://registry.yarnpkg.com=
附:
使用yarn同上,.yarnrc

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号