Nuxt3初始化项目报错: Failed to download https://raw.githubusercontent.com/nuxt/starter/

53 阅读1分钟

执行命令:

npx nuxi init ZHOUYI_Nuxt

错误信息:

Error: Failed to download template from registry: Failed to download https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json: TypeError: fetch failed

解决办法:

修改host文件 C:\Windows\System32\drivers\etc

image.png

2.取消勾选

image.png

3.将记事本使用管理员打开 C:\Windows\System32\drivers\etc 里面的 hosts文件

image.png

  1. 最后面添加这行
185.199.108.133 raw.githubusercontent.com
  1. 保存 重新执行npx nuxi init ZHOUYI_Nuxt 即可