当前位置:   article > 正文

安装element-ui组件的时候遇到npm ERR!解决办法_npm err! while resolving: element-ui@2.15.0 npm er

npm err! while resolving: element-ui@2.15.0 npm err! found: vue@3.4.27 npm e
  1. npm ERR! code ERESOLVE
  2. npm ERR! ERESOLVE could not resolve
  3. npm ERR!
  4. npm ERR! While resolving: @vue/eslint-config-standard@6.1.0
  5. npm ERR! Found: eslint-plugin-vue@8.7.1
  6. npm ERR! node_modules/eslint-plugin-vue
  7. npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
  8. npm ERR!
  9. npm ERR! Could not resolve dependency:
  10. npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
  11. npm ERR! node_modules/@vue/eslint-config-standard
  12. npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
  13. npm ERR!
  14. npm ERR! Conflicting peer dependency: eslint-plugin-vue@7.20.0
  15. npm ERR! node_modules/eslint-plugin-vue
  16. npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
  17. npm ERR! node_modules/@vue/eslint-config-standard
  18. npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
  19. npm ERR!
  20. npm ERR! Fix the upstream dependency conflict, or retry
  21. npm ERR! this command with --force, or --legacy-peer-deps
  22. npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  23. npm ERR!
  24. npm ERR! See C:\Users\50687\AppData\Local\npm-cache\eresolve-report.txt for a full report.
  25. npm ERR! A complete log of this run can be found in:
  26. npm ERR! C:\Users\50687\AppData\Local\npm-cache\_logs\2024-04-01T11_10_56_223Z-debug-0.log

在命令后面加--legacy-peer-deps,即:

npm i element-ui -S --legacy-peer-deps

就解决啦

--legacy-peer-deps命令是告诉npm不要去干什么,该命令并没有真的解决冲突,而是忽略了冲突,后续安各种插件出现这种问题都可以采用这种方法。

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

闽ICP备14008679号