0

when I run the command npm install, it displays this error:

[log@server:www]$ npm install
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! node_modules/vue
npm ERR!   dev vue@"^2.5.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.0.0" from [email protected]
npm ERR! node_modules/vee-validate
npm ERR!   vee-validate@"^4.2.3" 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 /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-06-09T01_39_40_386Z-debug.log

I wonder, how can I fix it? What does it mean?

Thanks

2 Answers 2

1

It looks like you're trying to install vee-validate version 4.0 in a Vue 2.x application. You can see the compatible version in the vee-validate repo.

How to fix:

Option 1:

Install an older version of Vee-validate (v2 or v3).

First, you'll need to uninstall the version you currently have installed (I'm assuming you installed vee-validate@next since that's the doc recommendation)

npm uninstall vee-validate@next

You can then find the list of versions available with

npm info vee-validate versions

Finally, install an older version with

npm install [email protected]

Replace the 3.4.9 with whatever version you would like to install - as of the time of writing, 3.4.9 is the latest stable tag

Option 2:

Upgrade from Vue 2 to Vue 3 following the upgrade guide.

Note that this is still a work in progress and may have some stability issues and depending on the state of the project I would consider using the above option for the time being.

-1

Step:-1 Make sure node.js is installed on your system. You can check with the command npm --version or node --version

Step:-2 Clear npm cache. run this command npm cache clear -f

Step:-3 Then try to run npm install

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.