創(chuàng)建nuxt3項(xiàng)目:npx nuxi@latest init nuxt3-project
報錯:
Error: Failed to download template from registry: Failed to download https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json: TypeError: fetch failed-
無法解析域名
raw.githubusercontent.com,這通常是由于 DNS 污染造成的,可以在電腦本地做域名解析,首先在域名解析網(wǎng)頁 解析出raw.githubusercontent.com對應(yīng)的ip地址,如下:
截屏2024-06-23 11.38.29.png 然后在系統(tǒng)的hosts文件添加如下配置:
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
2606:50c0:8000::154 raw.githubusercontent.com
2606:50c0:8001::154 raw.githubusercontent.com
2606:50c0:8002::154 raw.githubusercontent.com
2606:50c0:8003::154 raw.githubusercontent.com
- Windows系統(tǒng)hosts文件一般在:C:\Windows\System32\drivers\etc\hosts 路徑
- Mac系統(tǒng)在終端運(yùn)行:
sudo vi /etc/hosts修改hosts即可
