ng-bootstrap icon indicating copy to clipboard operation
ng-bootstrap copied to clipboard

Peer dependency error with angular 18 & ng-bootstrap latest

Open md-tanveruzzaman opened this issue 1 year ago • 7 comments

Bug description:

ng add @ng-bootstrap/ng-bootstrap@latest ℹ Using package manager: npm ✔ Package information loaded.

The package @ng-bootstrap/ng-bootstrap@latest will be installed and executed. Would you like to proceed? Yes npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: [email protected] npm error Found: @angular/[email protected] npm error node_modules/@angular/core npm error peer @angular/core@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/animations npm error peerOptional @angular/animations@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/platform-browser npm error peer @angular/platform-browser@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/forms npm error @angular/forms@"^18.0.0" from the root project npm error 4 more (@angular/platform-browser-dynamic, ...) npm error peer @angular/animations@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/platform-server npm error peerOptional @angular/platform-server@"^18.0.0" from @angular-devkit/[email protected] npm error node_modules/@angular-devkit/build-angular npm error dev @angular-devkit/build-angular@"^18.0.2" from the root project npm error 2 more (@angular/build, the root project) npm error 1 more (the root project) npm error peer @angular/core@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/common npm error peer @angular/common@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/forms npm error @angular/forms@"^18.0.0" from the root project npm error peer @angular/common@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/platform-browser npm error peer @angular/platform-browser@"18.0.2" from @angular/[email protected] npm error node_modules/@angular/forms npm error @angular/forms@"^18.0.0" from the root project npm error 4 more (@angular/platform-browser-dynamic, ...) npm error 5 more (@angular/platform-browser-dynamic, ...) npm error 9 more (@angular/compiler, @angular/forms, ...) npm error npm error Could not resolve dependency: npm error @ng-bootstrap/ng-bootstrap@"17.0.0" from the root project npm error npm error Conflicting peer dependency: @angular/[email protected] npm error node_modules/@angular/core npm error peer @angular/core@"18.0.4" from @angular/[email protected] npm error node_modules/@angular/forms npm error @angular/forms@"^18.0.0" from the root project npm error peer @angular/forms@"^18.0.0" from @ng-bootstrap/[email protected] npm error node_modules/@ng-bootstrap/ng-bootstrap npm error @ng-bootstrap/ng-bootstrap@"17.0.0" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\Admin\AppData\Local\npm-cache_logs\2024-06-26T05_21_59_054Z-eresolve-report.txt

npm error A complete log of this run can be found in: C:\Users\Admin\AppData\Local\npm-cache_logs\2024-06-26T05_21_59_054Z-debug-0.log ✖ Packages installation failed, see above.

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: my pakage.json "dependencies": { "@angular/animations": "^18.0.0", "@angular/common": "^18.0.0", "@angular/compiler": "^18.0.0", "@angular/core": "^18.0.0", "@angular/forms": "^18.0.0", "@angular/platform-browser": "^18.0.0", "@angular/platform-browser-dynamic": "^18.0.0", "@angular/platform-server": "^18.0.0", "@angular/router": "^18.0.0", "@angular/ssr": "^18.0.2", "@fortawesome/angular-fontawesome": "^0.15.0", "@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "express": "^4.18.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.14.3" }

ng-bootstrap: using latest tag

md-tanveruzzaman avatar Jun 26 '24 05:06 md-tanveruzzaman

When will NG Bootstrap support angular 18 please? You guys are awesome by the way.

RichardBoyder avatar Jun 26 '24 07:06 RichardBoyder

"@ng-bootstrap/ng-bootstrap": "^17.0.0", Released Now  !! You can check 

SkCodeRains avatar Jun 26 '24 09:06 SkCodeRains

"@ng-bootstrap/ng-bootstrap": "^17.0.0", Released Now  !! You can check 

Just tried but no luck

md-tanveruzzaman avatar Jun 26 '24 09:06 md-tanveruzzaman

"@ng-bootstrap/ng-bootstrap": "^17.0.0", Released Now  !! You can check 

It worked for me.

brianrodham avatar Jun 27 '24 05:06 brianrodham

It worked for me too, but I needed to update to the latest version of @angular, for example: ^18.0.1 to ^18.0.5

felipealbuquerq avatar Jul 02 '24 06:07 felipealbuquerq

uninstall the ngbootstrap , when migrating comes try to delete , package-lock.json. and then it will work fine !!

SkCodeRains avatar Jul 02 '24 08:07 SkCodeRains

for anyone else encountering this issue try ng update @angular/cli @angular/core and after retry ng add @ng-bootstrap/ng-bootstrap

attl8d avatar Sep 07 '24 14:09 attl8d