我想添加ng-bootstrap,但每次我试图添加它时,ERESOLVE都面对我:
ng add @ng-bootstrap/ng-bootstrap --legacy-peer-deps
ℹ Using package manager: npm
⚠ Unable to find compatible package. Using 'latest' tag.
⚠ Package has unmet peer dependencies. Adding the package may not succeed.
The package @ng-bootstrap/ng-bootstrap@12.1.2 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: admin-dashboard@0.0.0
npm ERR! Found: @angular/common@14.0.4
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^14.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^13.0.0" from @ng-bootstrap/ng-bootstrap@12.1.2
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"12.1.2" 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 /home/Coding/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/Coding/.npm/_logs/2022-07-03T12_48_18_862Z-debug-0.log
✖ Packages installation failed, see above.
ng版本的输出如下:
Angular CLI: 14.0.4
Node: 16.15.1
Package Manager: npm 8.11.0
OS: linux x64
Angular: 14.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1400.4
@angular-devkit/build-angular 14.0.4
@angular-devkit/core 14.0.4
@angular-devkit/schematics 14.0.4
@schematics/angular 14.0.4
rxjs 7.5.5
typescript 4.7.4
这里是关于我的系统nodejs和angular本身的所有信息。我已经为这个问题奋斗了大约10个小时,没有任何结果,请帮助!!
您是否对--force
标志尝试了相同的命令?这通常能奏效。
你在岛上并不孤单。这似乎是一个已知的问题:
https://github.com/ng-bootstrap/ng-bootstrap/issues/4340
听起来你可能需要使用Angular 13,直到这个问题得到修复。