Laravel 9 Install vue router for vue 2.6.12

Viewed 4546

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: vue@2.6.14 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 vue-router@4.0.14 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

I solved it by installing vue-router@3.

npm install vue-router@3 --save

You can just try this.

Related