I was trying to upgrade Nebular from 8.0.0 to 9.0.3.
So I updated the version in the package.json and tried to run npm i
.
And I received this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project@1.0.4
npm ERR! Found: @angular/common@14.2.9
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^14.2.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^13.0.0" from @nebular/auth@9.0.3
npm ERR! node_modules/@nebular/auth
npm ERR! @nebular/auth@"^9.0.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.
Now I have a question.
I've read a lot of questions about ERESOLVE unable to resolve dependency tree, but all the answers I get make you use "--legacy-peer-deps
", which is actually a workaround, not a real solution, because it just ignore the dependencies.
As I understood, my error means that @nebular/auth@9.0.3 had a peer dependency with @angular/common@^13.0.0, and in my project I'm using @angular/common@14.2.9.
I even tried to run npm info @nebular/auth peerDependencies
and it confirm it saying:
{
'@angular/common': '^13.0.0',
'@angular/core': '^13.0.0',
'@angular/router': '^13.0.0',
'@angular/forms': '^13.0.0',
'@nebular/theme': '9.1.0-rc.6',
rxjs: '^6.5.3 || ^7.4.0'
}
So, is there a way to solve this for my app in production in a definitively way? How can I actually fix this conflict without potentially further problems?
Thanks a lot!