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/[email protected]
npm ERR! Found: [email protected]
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/[email protected]
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 [email protected]
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/[email protected]
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: [email protected]
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.2.41" from @vueup/[email protected]
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
相关推荐
初遇你时动了情19 分钟前
html js 原生实现web组件、web公共组件、template模版插槽
前端·javascript·html
QQ27402875639 分钟前
Soundness Gitpod 部署教程
linux·运维·服务器·前端·chrome·web3
前端小崔1 小时前
从零开始学习three.js(18):一文详解three.js中的着色器Shader
前端·javascript·学习·3d·webgl·数据可视化·着色器
哎呦你好1 小时前
HTML 表格与div深度解析区别及常见误区
前端·html
运维@小兵1 小时前
vue配置子路由,实现点击左侧菜单,内容区域显示不同的内容
前端·javascript·vue.js
koiy.cc2 小时前
记录:echarts实现tooltip的某个数据常显和恢复
前端·echarts
一只专注api接口开发的技术猿2 小时前
企业级电商数据对接:1688 商品详情 API 接口开发与优化实践
大数据·前端·爬虫
GISer_Jing2 小时前
[前端高频]数组转树、数组扁平化、深拷贝、JSON.stringify&JSON.parse等手撕
前端·javascript·json
Yvonne爱编码3 小时前
CSS- 4.1 浮动(Float)
前端·css·html·github·html5·hbuilder
timeguys3 小时前
【前端】[vue3] [uni-app]使用 vantUI 框架
前端·uni-app