【vue】执行npm install element-ui -S报错
·
执行npm install element-ui -S报错
npm install element-ui -S
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: my-project0817@0.1.0
npm ERR! Found: vue@3.3.4
npm ERR! node_modules/vue
npm ERR! vue@"^3.2.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
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!
npm ERR! For a full report see:
npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache\_logs\2023-08-17T12_24_41_623Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\LENOVO\AppData\Local\npm-cache\_logs\2023-08-17T12_24_41_623Z-debug-0.log
解决方法
npm install element-plus --save
原因
参考的网站错误了,
npm install element-ui -S
对应的是https://element.eleme.cn/#/zh-CN/component/installation
npm install element-plus --save
对应的是 https://element-plus.gitee.io/zh-CN/
element-ui 的版本是这样匹配的vue@“^2.5.17” from element-ui@2.15.13
element-plus 匹配的版本是vue@“^5.08”
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)