I have a normal Angular project and also an Angular library.
Both used to be Angular 12, but today I decided to upgrade to Angular 13.
I did this with the commands of the Angular cli and everything seemed to work fine at first.
But after trying to install the library in my Angular project, I get an error message:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-main-project@1.0.0
npm ERR! Found: @angular/common@13.1.1
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~13.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^12.2.0" from my-library-project@0.0.12
npm ERR! node_modules/my-library-project
npm ERR! my-library-project@"*" 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.
This error message is very strange to me, because I upgraded both successfully to Angular 13. The package "my-library-project" does not have any reference to @angular/common@"^12.2.0". All dependencies, peer dependencies, the package.json etc. has only the Angular 13.1.
Even if I search the whole project for "@angular/common@"^12.2.0" I cant find it.
After a while I tried the following things:
- Deleting the node_modules folder in all projects and npm install again
- Clearing the NPM cache
- Deleting the package-lock.json
But still I get this strange error. I do not know anymore where I can still search for the old @angular/common package.
Any ideas?