Riandi geek
Riandi geek

Reputation: 31

Laravel 9 Install vue router for vue 2.6.12

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

Upvotes: 3

Views: 7338

Answers (2)

hamid choopani
hamid choopani

Reputation: 164

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]

Upvotes: 0

Rohit Italiya
Rohit Italiya

Reputation: 139

I solved it by installing vue-router@3.

npm install vue-router@3 --save

You can just try this.

Upvotes: 9

Related Questions