Unable to add ng-bootstrap 16 to Angular 17 version

  Kiến thức lập trình

It shows the below error :

npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR! peerOptional @angular/animations@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@”^17.3.0″ from the root project
npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR! @angular/animations@”^17.3.0″ from the root project
npm ERR! peer @angular/core@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@”^17.3.0″ from the root project
npm ERR! peer @angular/common@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@”17.3.6″ from @angular/[email protected]
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@”^17.3.0″ from the root project
npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR! 6 more (@angular/compiler, @angular/forms, …)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @ng-bootstrap/ng-bootstrap@”16.0.0″ from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@”17.3.7″ from @angular/[email protected]
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@”^17.3.0″ from the root project
npm ERR! peer @angular/forms@”^17.0.0″ from @ng-bootstrap/[email protected]
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@”16.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.

I tried this :

npm i @ng-bootstrap/ng-bootstrap –legacy-peer-deps

ng-bootstrap was installed. But was not able to do an import inside the styles.scss
and bootstrap styles were not reflecting in my localhost app.

New contributor

M V is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT