報錯問題:
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》
ping查看ip網絡情況
出現漏包情況:
正常情況:
更改本地hosts文件
Host配置:
在C:\Windows\System32\drivers\etc\hosts文件中加入一行:
185.199.110.133 raw.githubusercontent.com
繼續npx初始化nuxt項目即可、
npx nuxi@latest init <project-name>