bash
运行
npm cache clean --force
第二步:强制使用国内镜像安装(解决网络报错)
bash
运行
npm install --registry=https://registry.npmmirror.com --force
第三步:安装全局 vue 脚手架(解决命令不存在)
bash
运行
npm install -g @vue/cli --registry=https://registry.npmmirror.com
第四步:运行项目
bash
运行
npm run dev
为什么你会报错?
npm 网络报错 = 默认是国外源,国内连不上
→ 用 https://registry.npmmirror.com 国内镜像就好
vue-cli-service 不存在 = 依赖没安装 / 权限问题
→ 重新安装 + 全局安装脚手架即可修复
✅ 你现在只需要做:
关闭所有杀毒 / 安全软件 → 管理员打开 cmd → 进入项目
然后依次执行:
bash
运行
npm cache clean --force
npm install --registry=https://registry.npmmirror.com --force
npm install -g @vue/cli --registry=https://registry.npmmirror.com
npm run dev
执行完 立刻就能跑起来!
报错直接发截图,我马上帮你搞定!
如何查看系统环境变量?
如何配置系统环境变量?
如何在 Android Studio 中配置 ADB?