当前位置:   article > 正文

npm命令安装element-ui报错_npm i element-ui -s安装不成功

npm i element-ui -s安装不成功

报错如下

  1. C:\Users\39001\Desktop\qaccount>npm install element-ui -- force
  2. npm ERR! code ERESOLVE
  3. npm ERR! ERESOLVE unable to resolve dependency tree
  4. npm ERR!
  5. npm ERR! While resolving: qaccount@0.1.0
  6. npm ERR! Found: vue@3.2.33
  7. npm ERR! node_modules/vue
  8. npm ERR! vue@"^3.2.13" from the root project
  9. npm ERR!
  10. npm ERR! Could not resolve dependency:
  11. npm ERR! peer vue@"^2.5.17" from element-ui@2.15.8
  12. npm ERR! node_modules/element-ui
  13. npm ERR! element-ui@"*" from the root project
  14. npm ERR!
  15. npm ERR! Fix the upstream dependency conflict, or retry
  16. npm ERR! this command with --force, or --legacy-peer-deps
  17. npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  18. npm ERR!
  19. npm ERR! See C:\Users\39001\AppData\Local\npm-cache\eresolve-report.txt for a full report.
  20. npm ERR! A complete log of this run can be found in:
  21. npm ERR! C:\Users\39001\AppData\Local\npm-cache\_logs\2022-05-01T06_48_19_731Z-debug-0.log

出现此类问题是因为你的Vue版本和element版本不匹配,不要盲目的运行命令,如果使用的是Vue3一定要安装element-plus插件

运行命令为:

npm install element-plus --save

Vue2可以安装element-ui

运行i命令为:

npm i element-ui -S

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/641249
推荐阅读
相关标签
  

闽ICP备14008679号