Home > Software design >  unable to install the bootstrap
unable to install the bootstrap

Time:01-06

I am unable to install the ng bootstrap to my project. I keep getting the below error.

I have tried running the below commands but still no luck.

  1. npm install --legacy-peer-deps
  2. npm install latest-version

Below is the version i am using: Angular CLI: 12.0.3 Node: 14.17.5 Package Manager: npm 8.3.0

huss@Huss-MacBook-Air huss_web % ng add @ng-bootstrap/ng-bootstrap
Your global Angular CLI version (12.2.2) is greater than your local version (12.0.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false". ℹ Using package manager: npm ✔ Found compatible package version: @ng-bootstrap/[email protected]. ✔ Package information loaded.

The package @ng-bootstrap/[email protected] will be installed and executed.
Would you like to proceed? Yes
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@"~12.0.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.2.15" from @angular/[email protected]
npm ERR! node_modules/@angular/localize
npm ERR!   peer @angular/localize@"^12.0.0" from @ng-bootstrap/[email protected]
npm ERR!   node_modules/@ng-bootstrap/ng-bootstrap
npm ERR!     @ng-bootstrap/ng-bootstrap@"10.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 /Users/hussainsamiwala/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hussainsamiwala/.npm/_logs/2022-01-05T18_56_39_213Z-debug-0.log
✖ Package install failed, see above.
hussainsamiwala@Hussains-MacBook-Air huss_web % 

my package.json is as below:

{
  "name": "huss-web",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.0.3",
    "@angular/cdk": "^12.1.0",
    "@angular/common": "~12.0.3",
    "@angular/compiler": "~12.0.3",
    "@angular/core": "~12.0.3",
    "@angular/forms": "~12.0.3",
    "@angular/google-maps": "^12.1.0",
    "@angular/material": "^12.1.0",
    "@angular/platform-browser": "~12.0.3",
    "@angular/platform-browser-dynamic": "~12.0.3",
    "@angular/router": "~12.0.3",
    "@googlemaps/js-api-loader": "^1.12.1",
    "@types/jquery": "^3.5.6",
    "angular-ui-bootstrap": "^2.5.6",
    "bootstrap": "^5.1.0",
    "jquery": "^3.6.0",
    "jquery-ui": "^1.13.0",
    "latest-version": "^6.0.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.1.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.0.3",
    "@angular/cli": "~12.0.3",
    "@angular/compiler-cli": "~12.0.3",
    "@types/google.maps": "^3.45.6",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~3.7.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "typescript": "~4.2.3"
  }
}

CodePudding user response:

Try to run the commands with --force, or --legacy-peer-deps

CodePudding user response:

You can try this command.

npm i @ng-bootstrap/ng-bootstrap

CodePudding user response:

Try this:

Delete node_modules folder

npm install --force

ng add @ng-bootstrap/ng-bootstrap

  •  Tags:  
  • Related