报错内容
代码语言:shell复制 npm i element-ui -S
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vue@3.2.47
npm ERR! node_modules/vue
npm ERR! peer vue@"3.2.47" from @vue/server-renderer@3.2.47
npm ERR! node_modules/@vue/server-renderer
npm ERR! @vue/server-renderer@"3.2.47" from vue@3.2.47
npm ERR! peer vue@"^3.2.0" from vue-router@4.1.6
npm ERR! node_modules/vue-router
npm ERR! vue-router@"^4.1.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! element-ui@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@2.7.14
npm ERR! node_modules/vue
npm ERR! peer vue@"^2.5.17" from element-ui@2.15.13
npm ERR! node_modules/element-ui
npm ERR! element-ui@"*" 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! See /Users/naitang/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/naitang/.npm/_logs/2023-02-25T06_42_28_114Z-debug-0.log
vue安装element报错
或者安装其他报错
应该是版本问题
在安装命令后面加上
代码语言:shell复制-legacy-peer-deps
例如
代码语言:shell复制npm i element-ui -S -legacy-peer-deps