初始化项目失败
128字小于1分钟
2024-08-15
错误示例
npx nuxi init nuxt_template
Need to install the following packages:
nuxi@3.12.0
Ok to proceed? (y)
[上午9:54:44] ERROR Error: Failed to download template from registry: Failed to download https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json: TypeError: fetch failed
错误原因
- 无法对域名正确解析,导致访问失败,可以使用ping测试。
ping raw.githubusercontent.com
解决方法
修改系统hosts文件,将以下代码添加,将raw.githubusercontent.com
映射到 185.199.108.133
如果不行,点击地址查看最新ip.
185.199.108.133 raw.githubusercontent.com