Error installing Bootstrap (Ngb Module) in Angular

I want to install Ngb in Angular.
I use n Node.js version v19.1.0. I already tried –force and –legacy-pear-drops. Also i tried reinstalling Node.js.

The log:
`npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: markb@0.0.0
npm ERR! Found: @angular/core@14.2.2
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.2" from @angular/animations@14.2.2
npm ERR! node_modules/@angular/animations
npm ERR! peerOptional @angular/animations@"14.2.2" from @angular/platform-browser@14.2.2
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@"14.2.2" from @angular/forms@14.2.2
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.1.0" from the root project
npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR! @angular/animations@"^14.1.0" from the root project
npm ERR! peer @angular/core@"14.2.2" from @angular/common@14.2.2
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@"14.2.2" from @angular/forms@14.2.2
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.1.0" from the root project
npm ERR! peer @angular/common@"14.2.2" from @angular/platform-browser@14.2.2
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@"14.2.2" from @angular/forms@14.2.2
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.1.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@"13.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/core@14.2.12
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.12" from @angular/forms@14.2.12
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.1.0" from the root project
npm ERR! peer @angular/forms@"^14.1.0" from @ng-bootstrap/ng-bootstrap@13.1.1
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"13.1.1" 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.
npm ERR!
npm ERR! See C:\Users\thomas\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\thomas\AppData\Local\npm-cache_logs\2022-11-24T10_07_23_103Z-debug-0.log
× Packages installation failed, see above.`

I expected installs Bootstrap

>Solution :

First try npm config set legacy-peer-deps true. Maybe you must also run npm audit fix See also angular bootstrap is giving error on angular 13 project

Leave a Reply