nuxt3脚手架安装报错解决方法

当使用脚手架安装时

bash 复制代码
npx nuxi@latest init appname

错误1:ECONNRESET

bash 复制代码
npm error code ECONNRESET
npm error syscall read
npm error errno -4077
npm error network read ECONNRESET
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.

将网络dns改为114.114.114.114即可

错误2:Error: Failed to download template from registry: Failed to download https://raw.githubusercontent.com/nuxt/starter/templates/templates/v3.json: TypeError: fetch failed

修改HOSTS文件,添加以下内容

bash 复制代码
185.199.108.133 raw.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.110.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
2606:50c0:8000::154 raw.githubusercontent.com
2606:50c0:8001::154 raw.githubusercontent.com
2606:50c0:8002::154 raw.githubusercontent.com
2606:50c0:8003::154 raw.githubusercontent.com
相关推荐
这是个栗子19 分钟前
TypeScript(三)
前端·javascript·typescript·react
kvo7f2JTy24 分钟前
基于机器学习算法的web入侵检测系统设计与实现
前端·算法·机器学习
北风toto25 分钟前
前端CSS样式详细笔记
前端·css·笔记
nanfeiyan35 分钟前
git commit
前端
前端精髓3 小时前
移除 Effect 依赖
前端·javascript·react.js
码云之上3 小时前
从一个截图函数到一个 npm 包——pdf-snapshot 的诞生记
前端·node.js·github
码事漫谈4 小时前
AI提效,到底能强到什么程度?
前端·后端
IT_陈寒4 小时前
React hooks依赖数组这个坑差点把我埋了
前端·人工智能·后端
阿祖zu4 小时前
内容创作 AI 透明化声明倡议与项目开源
前端·后端·github
lpfasd1234 小时前
TypeScript + Cloudflare 全家桶部署项目全流程
前端·javascript·typescript