yarn的安装和卸载
npm install -g yarn
npm uninstall yarn -g //yarn卸载
本机的element-plus版本
"element-plus": "2.0.1",
想要切换的element-plus版本
由于我需要用到树型选择,所以需要升级到2.1.8
用npm卸载element-plus时报如下错误
npm uninstall element-plus
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! 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 element-plus@2.0.1
npm ERR! node_modules/element-plus
npm ERR! @element-plus/icons-vue@"0.2.6" from the root project
npm ERR! peer vue@"^3.0.0" from @vant/use@1.5.1
npm ERR! node_modules/@vant/use
npm ERR! @vant/use@"^1.5.1" from vant@4.3.1
npm ERR! node_modules/vant
npm ERR! vant@"^4.1.0" from the root project
npm ERR! 20 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-05-11T01_46_05_707Z-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-05-11T01_46_05_707Z-debug-0.log
改用yarn卸载试试
先安装yarn
npm install -g yarn
安装完之后运行yarn -v还是报错,后来找到yarn的安装位置添加环境变量到path就可以了
复制yarn安装目录下的bin路径,然后添加到path的最后
然后重新cmd运行yarn -v
yarn切换element-plus
yarn uninstall element-plus
原来yarn的安装和删除包和npm命令不一样
应该是yarn remove 包名
yarn remove element-plus
安装是add不是install
yarn add element-plus@2.1.8