yarn与npm更新报错
今天在用Github下载是总报错,其中错误一开始是DNS的问题
查资料后得知是DNS污染,之后就先找真实的IP地址,添加进C:\Windows\System32\drivers\etc hosts文件
后来问题是是GitHub的raw.githubusercontent.com无法链接
1、通过IPAddress.com首页,输入raw.githubusercontent.com查询到真实IP地址
199.232.68.133
C:\Windows\System32\drivers\etc
hosts文件
添加 以下内容并保存即可恢复
199.232.68.133 raw.githubusercontent.com
Ubuntu下方式为类似
只不过要注意权限和在sudo vim /etc/hosts 里面修改
2、设置VPN代理
yarn config set proxy http://username:password@server:port
yarn confit set https-proxy http://username:password@server:port
例:npm config set https-proxy http://xiaoming:123456@192.168.1.1:8080
取消代理
yarn config delete proxy
yarn config delete https-proxy

浙公网安备 33010602011771号