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

创建项目步骤

概览:

在安装 npm安装时会报错

复制代码
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
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/[email protected]
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: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR!   peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
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/[email protected] 依赖于 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
相关推荐
crazyme_612 分钟前
前端自学入门:HTML 基础详解与学习路线指引
前端·学习·html
撸猫79120 分钟前
HttpSession 的运行原理
前端·后端·cookie·httpsession
亦世凡华、39 分钟前
Rollup入门与进阶:为现代Web应用构建超小的打包文件
前端·经验分享·rollup·配置项目·前端分享
琉璃℡初雪1 小时前
vue2/3 中使用 @vue-office/docx 在网页中预览(docx、excel、pdf)文件
vue.js·pdf·excel
Bl_a_ck1 小时前
【React】Craco 简介
开发语言·前端·react.js·typescript·前端框架
为美好的生活献上中指2 小时前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
augenstern4162 小时前
webpack重构优化
前端·webpack·重构
海拥✘2 小时前
CodeBuddy终极测评:中国版Cursor的开发革命(含安装指南+HTML游戏实战)
前端·游戏·html
寧笙(Lycode)3 小时前
React系列——HOC高阶组件的封装与使用
前端·react.js·前端框架
asqq83 小时前
CSS 中的 ::before 和 ::after 伪元素
前端·css