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
相关推荐
小码哥_常2 分钟前
Spring Boot配置diff:解锁配置管理新姿势
前端
小码哥_常6 分钟前
告别onActivityResult!Android数据回传的3大痛点与终极解决方案
前端
hhcccchh19 分钟前
1.2 CSS 基础选择器、盒模型、flex 布局、grid 布局
前端·css·css3
专吃海绵宝宝菠萝屋的派大星1 小时前
使用Dify对接自己开发的mcp
java·服务器·前端
爱分享的阿Q1 小时前
Rust加WebAssembly前端性能革命实践指南
前端·rust·wasm
蓝黑20201 小时前
Vue的 value=“1“ 和 :value=“1“ 有什么区别
前端·javascript·vue
小李子呢02111 小时前
前端八股6---v-model双向绑定
前端·javascript·算法
He少年2 小时前
【基础知识、Skill、Rules和MCP案例介绍】
java·前端·python
史迪仔01122 小时前
[QML] QML IMage图像处理
开发语言·前端·javascript·c++·qt
AI_Claude_code2 小时前
ZLibrary访问困境方案四:利用Cloudflare Workers等边缘计算实现访问
javascript·人工智能·爬虫·python·网络爬虫·边缘计算·爬山算法