我将Angular版本从7更新到8。但是出现对等依赖错误

问题描述 投票:-4回答:3

我尝试使用--force,但没有用。

enter image description here

错误代码-

    Package "@ng-bootstrap/ng-bootstrap" has an incompatible peer dependency to   "@angular/common" (requires "^7.0.0" (extended), would install "9.1.9").
 Package "@swimlane/ngx-charts" has an incompatible peer dependency to "@angular/animations" (requires "6.x" (extended), would install "9.1.9").
                  Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.1.9").
                  Package "@swimlane/ngx-charts" has an incompatible peer dependency to "@angular/platform-browser" (requires "6.x" (extended), would install "9.1.9").
                  Package "@swimlane/ngx-charts" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires "^6.0.0" (extended), would install "9.1.9").
                  Package "@ng-bootstrap/ng-bootstrap" has an incompatible peer dependency to "@angular/forms" (requires "^7.0.0" (extended), would install "9.1.9").
                  Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0" (extended), would install "9.1.9").
                  Package "ngx-jsoneditor" has an incompatible peer dependency to "rxjs" (requires "^5.1.0", would install "6.5.5").
                  Package "ngx-jsoneditor" has an incompatible peer dependency to "zone.js" (requires "^0.8.4", would install "0.10.3").
angular angular7 angular8 npm-update
3个回答
1
投票

您需要安装每个依赖项的兼容版本,这是该代码的代码

npm i --save dependencyName@version

1
投票

希望尝试以下命令,它将得到修复

ng update @angular/cli @angular/core

0
投票

尝试添加force flag

ng update @angular/core --force
© www.soinside.com 2019 - 2024. All rights reserved.