【问题标题】:I created My angular project in Angular v8.1.3 , I want to run all the above angular version我在 Angular v8.1.3 中创建了我的角度项目,我想运行以上所有角度版本
【发布时间】:2022-11-23 14:50:59
【问题描述】:

我正在尝试将我的 Angular 应用程序从 v5 更新到 v6。 我已经成功运行了所有这些命令:

npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli

问题是我在运行此命令时遇到错误:

ng更新@angular/core

  Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0" (extended), would install "15.0.1").
                  Package "@angular-devkit/build-angular" has an incompatible peer dependency to "@angular/compiler-cli" (requires "^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9" (extended), would install "15.0.1").
                  Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0" (extended), would install "15.0.1").
                  Package "@angular/material" has an incompatible peer dependency to "@angular/animations" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "15.0.1").
                  Package "@angular/material" has an incompatible peer dependency to "@angular/forms" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "15.0.1").
                  Package "ngx-toastr" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=6.0.0 <9.0.0" (extended), would install "15.0.1").
                  Package "@angular/cdk" has an incompatible peer dependency to "@angular/common" (requires "^8.0.0 || ^9.0.0-0" (extended), would install "15.0.1").
                  Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.1 < 3.5", would install "4.8.4").
                  Package "@ng-bootstrap/ng-bootstrap" has an incompatible peer dependency to "rxjs" (requires "^6.3.0", would install "7.5.7").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

我不确定如何处理这个问题,我不想自己尝试以避免破坏应用程序。

有人可以建议该怎么做吗?

我目前的依赖如下:

【问题讨论】:

    标签: angular angular-dependency-injection


    【解决方案1】:

    您不应该在更新之前等待太久,否则很难升级。 Angular v15 已经发布,所以你现在至少应该有 Angular v13。我建议您始终在版本可用时更新到最新版本。

    您可以按照以下文档进行操作。您必须逐个更新每个版本。即从 5 更新到 6,然后从 6 更新到 7,等等。

    https://update.angular.io/?v=5.0-6.0

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-14
      • 2020-04-08
      • 2021-08-20
      • 1970-01-01
      • 2023-01-30
      • 2023-03-10
      • 2018-04-03
      • 1970-01-01
      相关资源
      最近更新 更多