3

I try installing vue router with run command "npm install vue-router" but then showing error like this:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: [email protected] npm ERR! dev vue@"^2.6.12" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer vue@"^3.2.0" from [email protected] npm ERR! node_modules/vue-router npm ERR! vue-router@"*" from the root project npm ERR! 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\ACER\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\ACER\AppData\Local\npm-cache_logs\2022-03-20T12_19_15_072Z-debug-0.log

please help

2 Answers 2

9

I solved it by installing vue-router@3.

npm install vue-router@3 --save

You can just try this.

0

Because your vue is not the latest version, it gives this error.

Use previous versions of vue-router.

To access old versions of vue-router, use the versions tab

Example : npm i [email protected]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.