【问题标题】:I am updating Angular version from 7 to 8. But getting peer dependency error [closed]我正在将 Angular 版本从 7 更新到 8。但出现对等依赖错误 [关闭]
【发布时间】:2020-09-19 12:15:18
【问题描述】:

我尝试使用 --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").

【问题讨论】:

  • 请注意,minimal reproducible example as text 必须在问题本身中。不接受截图。 屏幕图片更不用说了。
  • 提示:使用 powershell 或 VS Code 的终端。它可以让您轻松复制文本。

标签: angular angular7 angular8 npm-update


【解决方案1】:

希望尝试下面的命令,它会被修复

ng update @angular/cli @angular/core

【讨论】:

  • 我累了...但同样的问题@Dev216
  • 尝试更新 --all --force
  • 如果它不起作用,那么你运行下面的命令---- ng update @angular/cli @angular/core --force
  • npm i @angular/cdk@8 @angular/compiler-cli@8 @angular/material@8 rxjs@8 --save
  • @Owais 现在你的问题解决了吗?
【解决方案2】:

尝试添加force flag

ng update @angular/core --force

【讨论】:

    【解决方案3】:

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

    npm i --save dependencyName@version
    

    【讨论】:

    • 你能从上面的错误中发布一些例子吗...我是角度@Ess的新手
    • 如果您已经安装了依赖项,请使用此ng update swimlane/ngx-charts@~8.2.12,否则以这种方式执行npm i swimlane/ngx-charts@^8.2.12 --save。如果您需要更多详细信息,请查看:checkMe
    猜你喜欢
    • 2022-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-20
    • 2023-02-09
    • 1970-01-01
    相关资源
    最近更新 更多