Reputation: 47
I am trying to install npm install --save @ng-bootstrap/ng-bootstrap getting following error. Please help me to resolve this issue.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/compiler
npm ERR! @angular/compiler@"~13.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"13.2.3" from @angular/[email protected]
npm ERR! node_modules/@angular/localize
npm ERR! peer @angular/localize@"^13.0.0" from @ng-bootstrap/[email protected]
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"^12.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.
npm ERR!
npm ERR! See C:\Users\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\AppData\Local\npm-cache\_logs\2022-02-19T20_02_59_711Z-debug-0.log
Upvotes: 2
Views: 20826
Reputation: 1
If you're facing issues installing ng-bootstrap using npm, you might want to try installing it with yarn instead. Here's how:
First, make sure you have yarn installed globally by running:
npm install -g yarn
Once you have yarn, you can install ng-bootstrap by running:
yarn add ng-bootstrap
This should install ng-bootstrap and its dependencies successfully.
I hope this helps!
Upvotes: 0
Reputation: 321
A known bug, you can observe it here: https://github.com/angular/angular-cli/issues/22333
As they mention, you can:
npm install --save --legacy-peer-deps
UPDATED
It helped me to upgrade the libraries to version 13.1.2 ng update @angular/core
Upvotes: 6