raw.githubusercontent.com 下的网址安装失败问题

系统

创建 nuxt 项目的时候报错:

ERROR Error: Failed to download template from registry: Failed to download v3 template info from https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json: 404 Not Found

alt text

解决方式

首先修改设备的 dns 设置,使用公共 DNS 服务(8.8.8.8)。

然后,刷新本地 DNS 缓存:macOS,在终端中运行 sudo killall -HUP mDNSResponder

最后清除 npm 缓存:npm cache clean --force

问题解决。

alt text