3

In Angular-14 project, I have this package.json:

package.json:

"dependencies": {
  "@angular/animations": "^14.0.0",
  "@angular/common": "^14.0.0",
  "@angular/compiler": "^14.0.0",
  "@angular/core": "^14.0.0",
  "@angular/forms": "^14.0.0",
  "@angular/platform-browser": "^14.0.0",
  "@angular/platform-browser-dynamic": "^14.0.0",
  "@angular/router": "^14.0.0",
  "@rxweb/reactive-form-validators": "^2.1.7",
  "admin-lte": "3.2",
  "google-libphonenumber": "^3.2.28",
  "intl-tel-input": "^17.0.3",
  "ngx-toastr": "^14.3.0",
  "npm-check": "^5.9.2",
  "rxjs": "~7.5.0",
  "sweetalert2": "^11.4.17",
  "tslib": "^2.3.0",
  "zone.js": "~0.11.4"
},

So, as I decide to install ngx-bootstrap using ngx bootstrap:

npm install ngx-bootstrap --save

I got this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ddm-ui@0.0.0
npm ERR! Found: @angular/animations@14.0.1
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"^14.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"^13.0.0" from ngx-bootstrap@8.0.0
npm ERR! node_modules/ngx-bootstrap
npm ERR!   ngx-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.
npm ERR!

It was working in Angular-13

How do I get this resolved?

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
Ayobamilaye
  • 1,099
  • 1
  • 17
  • 46
  • 2
    "ng-bootstrap@8.0.0" has a peer dependency on "@angular/animations@"^13.0.0". You could, as the error message suggests accept the incorrect dependancy resolution. npm install ngx-bootstrap@latest --legacy-peer-deps – Robin Webb Jun 15 '22 at 14:45
  • Also, when we use 3rd party libs, we must be very sure that all of them are ready for the next version, you are maybe a little bit soon with Angular 14 ;) – Alain Boudard Jun 15 '22 at 15:13

3 Answers3

6

run this: npm install ngx-bootstrap@latest --legacy-peer-deps. It worked for me hope it will for someone in the future

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
Soy Diabs
  • 122
  • 2
0

On the official website it says that there is no compatibility with angular version 14.

look here

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 17 '22 at 17:16
0
  • Run, it's fixed the issue for me:-
npm install ngx-bootstrap --save --force
Mahmmoud Kinawy
  • 551
  • 4
  • 11
  • 1
    This answer has already been given by others (except for the `--save` flag, which doesn't matter in this case anyway). – ahuemmer Jul 26 '22 at 06:22