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
相关推荐
yashunan27 分钟前
Web_php_unserialize
android·前端·php
m0_zj35 分钟前
17.[前端开发]Day17-形变-动画-vertical-align
前端·css·chrome·html·html5
Edward-tan1 小时前
【玩转全栈】--创建一个自己的vue项目
前端·javascript·vue.js
青年夏日科技工作者1 小时前
虚幻浏览器插件 UE与JS通信
前端·javascript·html
雷神乐乐2 小时前
创建前端项目的方法
前端·javascript·vue.js
prince_zxill2 小时前
JavaScript面向对象编程:Prototype与Class的对比详解
前端·javascript·ecmascript·原型模式
计算机-秋大田3 小时前
基于SpringBoot的美食烹饪互动平台的设计与实现(源码+SQL脚本+LW+部署讲解等)
vue.js·spring boot·后端·课程设计·美食
D.eL3 小时前
Vue 2 项目中 Mock.js 的完整集成与使用教程
前端·javascript·vue.js
brzhang3 小时前
墙裂推荐一个在 Apple Silicon 上创建和管理虚拟机的轻量级开源工具:lume
前端·后端
轻口味4 小时前
Vue.js 响应式引用与响应式数据(`ref` 和 `reactive`)
vue.js