npm install报错——npm ERR! code ERESOLVE及解决方法

一、问题描述

vue项目执行npm install下载依赖的时候报如下错误

kotlin 复制代码
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vueup/vue-quill@1.1.0
npm ERR! Found: vue@3.2.26
npm ERR! node_modules/vue
npm ERR!   vue@"3.2.26" from the root project
npm ERR!   peer vue@"^3.2.0" from @element-plus/icons-vue@0.2.6
npm ERR!   node_modules/@element-plus/icons-vue
npm ERR!     @element-plus/icons-vue@"0.2.6" from the root project
npm ERR!     @element-plus/icons-vue@"^0.2.6" from element-plus@2.0.1
npm ERR!     node_modules/element-plus
npm ERR!       element-plus@"2.0.1" from the root project
npm ERR!   18 more (@vue/server-renderer, @wangeditor/editor-for-vue, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.2.41" from @vueup/vue-quill@1.1.0
npm ERR! node_modules/@vueup/vue-quill
npm ERR!   @vueup/vue-quill@"^1.0.0-alpha.40" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@3.2.47
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.2.41" from @vueup/vue-quill@1.1.0
npm ERR!   node_modules/@vueup/vue-quill
npm ERR!     @vueup/vue-quill@"^1.0.0-alpha.40" 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.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\35725\AppData\Local\npm-cache\_logs\2023-02-23T01_55_09_830Z-eresolve-report.txt
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\35725\AppData\Local\npm-cache\_logs\2023-02-23T01_55_09_830Z-debug-0.log

二、解决方法

下载命令--legacy-peer-deps即可正常

css 复制代码
npm i --legacy-peer-deps
相关推荐
恋猫de小郭2 分钟前
Flutter 官方 LLM 动态 UI 库 flutter_genui 发布,让 App UI 自己生成 UI
android·前端·flutter
kymjs张涛25 分钟前
零一开源|前沿技术周刊 #15
前端·javascript·面试
reacx27 分钟前
# 第三章:状态管理架构设计 - 从 Zustand 到 React Query 的完整实践
前端
古夕28 分钟前
Vue3 + vue-query 的重复请求问题解决记录
前端·javascript·vue.js
不知名程序员第二部28 分钟前
前端-业务-架构
前端·javascript·代码规范
Bug生产工厂28 分钟前
React支付组件设计与封装:从基础组件到企业级解决方案
前端·react.js·typescript
小喷友29 分钟前
阶段三:进阶(Rust 高级特性)
前端·rust
华仔啊29 分钟前
面试官:请解释一下 JS 的 this 指向。别慌,看完这篇让你对答如流!
前端·javascript
Strayer29 分钟前
Tauri2.0打包构建报错
前端
小高00731 分钟前
💥💥💥前端“隐藏神技”:15 个高效却鲜为人知的 Web API 大起底
前端·javascript