发生背景
按照 Nuxt3 官方文档,运行:
$ npx nuxi init nuxt3-app
恭喜,获得一个 ERROR !
错误信息
ERROR Error:
Failed to download template from registry: request to https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json failed,
reason: Hostname/IP does not match certificate's altnames:
Host: raw.githubusercontent.com. is not in the cert's altnames:
DNS:default.ssl.fastly.net,
DNS:fastly.com,
DNS:*.a.ssl.fastly.net,
DNS:*.hosts.fastly.net,
DNS:*.global.ssl.fastly.net,
DNS:*.fastly.com,
DNS:a.ssl.fastly.net,
DNS:purge.fastly.net,
DNS:mirrors.fastly.net,
DNS:control.fastly.net,
DNS:tools.fastly.net
解决方案
报错信息说请求 https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json
时 SSL 验证失败,既然这样,手动访问一下不就行了?
问题不大,启动 Steam++ ,勾选 Github 那一项,它会帮忙重新签名。
得到了以下数据:
{
"name": "v3",
"defaultDir": "nuxt-app",
"url": "https://nuxt.com",
"tar": "https://codeload.github.com/nuxt/starter/tar.gz/refs/heads/v3"
}
tar
对应的值是 https://codeload.github.com/nuxt/starter/tar.gz/refs/heads/v3
,在浏览器无痕模式中打开,开始下载~
下载完解压出来就 OK 了:
注意:此时需要退出 Steam++ ,不然会重定向到 Github 主站。
原因
可能没装那个根证书吧,具体的不太懂,等待大佬解答。