1

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: bidashboard@0.0.0
npm ERR! Found: @angular/compiler@13.1.3
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/localize@13.2.3
npm ERR! node_modules/@angular/localize
npm ERR!   peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@12.0.0
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

Version Info

Giorgio
  • 148
  • 4
  • 12
SIW
  • 37
  • 1
  • 1
  • 4

3 Answers3

5

A known bug, you can observe it here: https://github.com/angular/angular-cli/issues/22333

As they mention, you can:

  1. Updated npm install --save --legacy-peer-deps
  2. Set yarn as default package manager. Instruction https://codinglatte.com/posts/angular/setup-angular-touse-yarn-package-manager

UPDATED
It helped me to upgrade the libraries to version 13.1.2 ng update @angular/core

Ania
  • 292
  • 4
  • 11
  • Folks, I was facing a dependency conflict with Angular 12.2.1 (in the project) and the root angular installation of Angular 12.2.2. The ng update command mentioned above helped me. It upgraded my local angular installation to 12.2.2 and I could install bootstrap. – Saswata Mishra Mar 13 '23 at 12:30
4

Run this command

npm install --save --legacy-peer-deps

abdella
  • 490
  • 5
  • 11
  • Yes it works, Thank you abdella!!!!! I used "npm install --save --legacy-peer-deps @ng-bootstrap/ng-bootstrap" – SIW Feb 20 '22 at 03:02
0

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!