创建Nux3项目失败?
我们在使用npx nuxi init Product的时候可能会看见这个报错
ERROR Failed to download template from registry: request to https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json failed, reason: getaddrinfo ENOENT raw.githubusercontent.com
测试是否能正常访问
打开cmd 输入ping raw.githubusercontent.com
如果要是ping不通就说明我们不能访问那么创建项目肯定也是不行的
解决方案
- 复制
https://raw.githubusercontent.com
- 打开百度搜索网站ip查询
随便哪个都行只要能查到ip就行
这里我推荐一个网站https://ipchaxun.com/
- 在查询框输入
raw.githubusercontent.com
你就能看到你查询到的nuxt3ip地址
* 打开你的此电脑 按照这个目录扎到这个文件
* 用你的vscode打开这个hosts文件 在该文件的最后一行加上这个字段
185.199.110.133 raw.githubusercontent.com
ip是你查到的ip 网站是你复制的网站 - 最后打开的你的cmd再次ping一下试试基本没啥大问题了
- 点个赞:美女or兄弟or彭于晏