Error: getaddrinfo ENOENT raw.githubusercontent.com 无法访问

在使用npm安装依赖时,报如下错误:

9895 error compiling from source
9896 error getaddrinfo ENOENT raw.githubusercontent.com
9896 error gifsicle pre-build test failed
9896 error Error: Command failed: C:\Windows\system32\cmd.exe /s /c "autoreconf -ivf"
9896 error 'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
9896 error ���������ļ���
9896 error
9896 error

原因分析:

无法解析raw.githubusercontent.com地址,需要FQ或者配置本地host文件

解决方法:
查看raw.githubusercontent.com的真实IP地址,打开 https://site.ip138.com/raw.Githubusercontent.com/ 查看下面的IP,复制一个,ping一下看下通不通,不通就用下面其它的ping ,通了才能用。

 

 

 

修改C:\Windows\System32\drivers\etc\hosts,把复制的IP添加进去,保存

185.199.111.133 raw.githubusercontent.com

  

 

posted @ 2023-10-17 07:06  猪脚踏浪  阅读(895)  评论(0编辑  收藏  举报