使用命令 npm create nuxt nuxt-app 安装 Nuxt 遇到错误
Error: Failed to download template from registry: Failed to download https://raw.githubusercontent.com/nuxt/starter/templates/templates/module.json: TypeError: fetch failed
- 查询
raw.githubusercontent.com域名的服务器ip地址
打开 https://www.ipaddress.com/ 在 Lookup any IP Address or Website 栏 输入
raw.githubusercontent.com
或直接打开https://www.ipaddress.com/website/raw.githubusercontent.com
将最下面的几列ip 复制

打开电脑的
:\Windows\System32\drivers\etc\hosts文件 增加以下地址
ip1 raw.githubusercontent.com
ip2 raw.githubusercontent.com
- 保存hosts文件后重新运行
npm create nuxt nuxt-app