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
相关推荐
咬人喵喵25 分钟前
E2.COOL 平台深度解析:从特效分类到实战操作指南
前端·编辑器·svg
RisunJan1 小时前
Linux命令-named-checkzone
linux·前端
小陈工1 小时前
Python Web开发入门(十):数据库迁移与版本管理——让数据库变更可控可回滚
前端·数据库·人工智能·python·sql·云原生·架构
吹晚风吧1 小时前
解决vite打包,base配置前缀,nginx的dist包找不到资源
服务器·前端·nginx
weixin199701080162 小时前
《施耐德商品详情页前端性能优化实战》
前端·性能优化
不想上班只想要钱2 小时前
模板里 item.xxx 报错 ,报 item的类型为未知
前端·vue
阿琳a_3 小时前
在github上部署个人的vitepress文档网站
前端·vue.js·github·网站搭建·cesium
酉鬼女又兒3 小时前
零基础快速入门前端ES6 核心特性详解与蓝桥杯 Web 考点实践(可用于备赛蓝桥杯Web应用开发)
开发语言·前端·职场和发展·蓝桥杯·es6·css3·html5
Zk.Sun3 小时前
【RK3588 Mali610 适配 Qt6 】
前端·javascript·vue.js
不想吃菠萝3 小时前
vue3+ts 使用postcss-pxtorem依赖进行rem适配
前端·javascript·vue.js·postcss