動態

詳情 返回 返回

解決nuxt3初始化項目報錯問題 - 動態 詳情

報錯問題:

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網站無法訪問,這時我們需要修改本地host,更換raw.githubusercontent.comIP即可

查看IPS

找到底部綁定的IP池,使用cmd命令ping,看哪個ip網絡比較好,有些ip出現漏包情況
查看DNS《raw.githubusercontent.com》
image.png

ping查看ip網絡情況

出現漏包情況:
image.png

正常情況:
image.png

更改本地hosts文件

Host配置:
在C:\Windows\System32\drivers\etc\hosts文件中加入一行:
185.199.110.133 raw.githubusercontent.com
image.png

繼續npx初始化nuxt項目即可、

npx nuxi@latest init <project-name>

Add a new 評論

Some HTML is okay.