Dependency Error after upgrate to angular 18
iferpaz7 opened this issue · comments
I'm also having similar issues after upgrading my project to Angular 18.
Minimal Reproduction Scenario:
- install angular/cli v18
npm i -g @angular/cli
- generate new Angular app
ng new test-app
- install ng-bootstrap
ng add @ng-bootstrap/ng-bootstrap
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test-app@0.0.0
npm ERR! Found: @angular/common@18.0.0
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^17.0.0" from @ng-bootstrap/ng-bootstrap@16.0.0
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"*" 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.
I found the following discussion in the PR for Angular 18 for a temporary fix, but I get the following error when trying to run ng g @ng-bootstrap/ng-bootstrap:ng-add
:
An unhandled exception occurred: Collection "@ng-bootstrap/ng-bootstrap" cannot be resolved.
Or I get the following if I try to add ng-bootstrap ng add @ng-bootstrap/ng-bootstrap
:
npm ERR! Unable to resolve reference $@angular/localize
This issue is a duplicate of #4703.
#4704 (comment) there is a workaround posted in the PR for Angular 18
Thanks