vue3创建新项目
记录本次创建项目遇到的问题
一、cmd创建报错
npm init vite@latest
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmmirror.com/create-vite failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-05-29T02_54_50_629Z-debug-0.log
经过csdn搜索好像是之前的淘宝镜像代理到期了,参考文章: link
卧槽,这里真的是裂开,换成淘宝最新镜像https://registry.npm.taobao.org没有用,搞了半天换成华为云镜像https://mirrors.huaweicloud.com/repository/npm/创建项目
总结
这个报错主要是镜像有问题,多换几个镜像试试就行