vue记录:导入element ui时报错及解决
2023-08-08 本文已影响0人
ning_e83f
使用 npm i element-ui -S导入element ui,报错信息如下
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR!While resolving:toolscat@0.0.0
npm ERR!Found:vue@3.3.4
npm ERR! node_modules/vue
npm ERR! vue@"^3.3.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peervue@"^2.5.17" fromelement-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 i --legacy-peer-deps
然后用npm i element-ui -S --legacy-peer-deps导入element ui