I want to install @adonisjs/validator in my adonis project, with the command:
adonis install @adonisjs/validator
but I get this error
[1/1] ❌ Installation failed [@adonisjs/validator]
ERROR Command failed: npm i --save @adonisjs/validator
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @adonisjs/[email protected]
npm ERR! node_modules/@adonisjs/bodyparser
npm ERR! @adonisjs/bodyparser@"~2.0.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @adonisjs/bodyparser@"^7.0.0" from @adonisjs/[email protected]
npm ERR! node_modules/@adonisjs/validator
npm ERR! @adonisjs/validator@"^11.0.0" 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\juanv\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\juanv\AppData\Local\npm-cache\_logs\2021-04-30T04_38_03_282Z-debug.log
then run this command:
npm i --save @adonisjs/validator
and I get another error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @adonisjs/[email protected]
npm ERR! node_modules/@adonisjs/bodyparser
npm ERR! @adonisjs/bodyparser@"~2.0.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @adonisjs/bodyparser@"^7.0.0" from @adonisjs/[email protected]
npm ERR! node_modules/@adonisjs/validator
npm ERR! @adonisjs/validator@"^11.0.0" 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\juanv\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\juanv\AppData\Local\npm-cache\_logs\2021-04-30T04_40_33_919Z-debug.log
try to create a new project and just install @adonisjs/validator, but I get the same error, I already cleared cache with the command:
npm cache clean --force
and delete the node_modules folder and reinstall the dependencies with:
npm install --save
but it keeps giving me the same error, thanks
The packages for version 4.x just got an update and now you need to add legacy for download.
So write your command like this:
Links of interest: