在创建nuxt3项目中碰到一直无法拉取github远程地址的远程模板,无法通过官方提供的脚手架命令创建项目
npx nuxi init [project-name] 进行项目创建
出现的错误信息是:Error: Failed to download template from registry: fetch failed
解决方案一:通过git去拉取项目模板:
git clone -b v3 https://github.com/nuxt/starter.git
解决方案二: 修改系统hosts文件
修改`C:\Windows\System32\drivers\etc`路径下的hosts文件
# Nuxt3
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
创建nuxt2项目命令:yarn create nuxt-app正常使用