执行yarn的时候报错如下:
Error: getaddrinfo ENOENT raw.githubusercontent.com

这是由于本机访问raw.githubusercontent.com网址有问题,需要定位一下网站ip
首先点开网址 https://www.ipaddress.com/ ,输入raw.githubusercontent.com,点击查询:

然后往下翻可以看到4个ip

复制这个ip,修改hosts文件
找到hosts这个文件夹:C:\Windows\System32\drivers\etc

然后,以管理员身份打开记事本:

在最后一行将如下代码复制进去
185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com

保存之后重新执行指令,就不会报错了!
2709

被折叠的 条评论
为什么被折叠?



