Home > Net >  cant install element ui on vue project
cant install element ui on vue project

Time:03-02

PS C:\Users\user\Desktop\dev\Phone 4 U> npm install element-ui -S

npm ERR! code ERESOLVE

npm ERR! ERESOLVE unable to resolve dependency tree

npm ERR!

npm ERR! While resolving: [email protected]

npm ERR! Found: [email protected]

npm ERR! node_modules/vue

npm ERR! vue@"^3.2.29" from the root project

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer vue@"^2.5.17" from [email protected]

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! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2022-03-01T09_07_40_576Z-debug.log
PS C:\Users\user\Desktop\dev\Phone 4 U>

trying to install Element and getting this error

CodePudding user response:

element-ui has peer dependency vue@"^2.5.17" and you seem to have a requirement at the root of your project with vue@"^3.2.29" .

Maybe just try to modify your package.json to fix the conflict with:

{
  "dependencies": {
    "element-ui": "^2.15.6",
    "vue":"^2.5.17"
    // ...

  }
}
  • Related