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
相关推荐
独泪了无痕3 小时前
使用Fetch API 探索前后端数据交互
前端·http·交互设计
css趣多多3 小时前
别名路径的知识点
前端
靓仔建5 小时前
Vue3导入组件出错does not provide an export named ‘user_setting‘ (at index.vue:180:10)
开发语言·前端·typescript
EnoYao5 小时前
我写了一个团队体检报告 Skill,把摸鱼的同事扒出来了😅
前端·javascript
梁正雄5 小时前
Python前端-2-css练习
前端·css·python
清汤饺子5 小时前
用 Cursor 半年了,效率还是没提升?是因为你没用对这 7 个功能
前端·后端·cursor
蓝莓味的口香糖5 小时前
【vue3】组件的批量全局注册
前端·javascript·vue.js
wefly20176 小时前
开发者效率神器!jsontop.cn一站式工具集,覆盖开发全流程高频需求
前端·后端·python·django·flask·前端开发工具·后端开发工具
独泪了无痕6 小时前
自动导入 AutoImport:告别手动引入依赖,优化Vue3开发体验
前端·vue.js·typescript
GDAL6 小时前
MANIFEST.in简介
linux·服务器·前端·python