vue-cli自定义创建项目-eslint依赖冲突解决方式

创建项目步骤

概览:

在安装 npm安装时会报错

复制代码
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/eslint-config-standard@6.1.0
npm ERR! Found: eslint-plugin-vue@8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR!   dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR!   dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-vue@7.20.0
npm ERR! node_modules/eslint-plugin-vue
npm ERR!   peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR!   node_modules/@vue/eslint-config-standard
npm ERR!     dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

依赖冲突原因:
@vue/eslint-config-standard@6.1.0 依赖于 eslint-plugin-vue 的 ^7.0.0 版本,但是项目中安装了更高版本的eslint-plugin-vue

解决方式:降级eslint-plugin-vue到@vue/eslint-config-standard支持的版本

复制代码
npm install eslint-plugin-vue@^7.0.0

解决后:

再进行npm安装,就能成功

复制代码
npm i --registry https://registry.npmmirror.com vant@latest-v2 -S
相关推荐
普通码农1 天前
uni.setClipboardData在 iOS 剪贴板复制失败解决方案
前端
_孤傲_1 天前
webpack实现常用plugin
前端·webpack·node.js
golang学习记1 天前
从0死磕全栈之Next.js 字体优化实战:零布局偏移、高性能、隐私友好的字体加载方案
前端
zachhere1 天前
深入了解 OpenAI Apps SDK 的内部机制
前端
张可爱1 天前
20251015-Vue3八股文整理
前端
ruanCat1 天前
记一次因 vue-router 升级而导致的 uniapp 故障
前端·vue.js
Damon小智1 天前
基于 Rokid JSAR 打造精致的 3D 白色飞机模型
前端·虚拟现实
Mintopia1 天前
🌌 知识图谱与 AIGC 融合:
前端·javascript·aigc
三十_1 天前
TypeORM 基础篇:项目初始化与增删改查全流程
前端·后端