angulartypescriptng-bootstrapangular18

How to use ng-bootstrap with Angular 18


I just updated my angular app to Angular 18 and now seems that there is no compatible version of ng-bootstrap for angular 18?

While resolving: @ng-bootstrap/ng-bootstrap@16.0.0
npm error Found: @angular/common@18.0.6
npm error node_modules/@angular/common
npm error   @angular/common@"18.0.6" from the root project
npm error   peer @angular/common@"^18.0.0 || ^19.0.0" from @angular/cdk@18.0.6
npm error   node_modules/@angular/cdk
....
Could not resolve dependency:
npm error peer @angular/common@"^17.0.0" from @ng-bootstrap/ng-bootstrap@16.0.0
npm error node_modules/@ng-bootstrap/ng-bootstrap
npm error   @ng-bootstrap/ng-bootstrap@"16.0.0" from the root project
npm error
npm error Conflicting peer dependency: @angular/common@17.3.11
npm error node_modules/@angular/common
npm error   peer @angular/common@"^17.0.0" from @ng-bootstrap/ng-bootstrap@16.0.0
npm error   node_modules/@ng-bootstrap/ng-bootstrap
npm error     @ng-bootstrap/ng-bootstrap@"16.0.0" from the root project

I have a nx workspace with more than three apps and some libs. Any idea how to handle it in a best way?


Solution

  • According to Angular Powered Bootstrap Documentation

    Angular ^18.0.0 
    ng-bootstrap 17.x.x
    Bootstrap CSS 5.3.2 
    Popper ^2.11.8