繁体   English   中英

将 angular 版本从 12 升级到 13 时出错,发现不兼容的对等依赖项

[英]Error when upgrading angular version from 12 to 13 incompatible peer dependencies found

我正在尝试从 Angular 版本 12 升级到版本 14。所以为了做到这一点,我首先需要将 Angular 的版本升级到 13,然后仅从版本 13 到 14 进行类似的操作。

我正在为此使用 Angular 更新指南。 具体来说,我遵循第一个命令,即:

ng update @angular/core@13 @angular/cli@13 我还要补充一点,Angular CLI (14.1.0) 的全球版本大于本地版本 (12.0.2)。

在控制台中,我收到此错误消息:

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 13.3.9 to perform the update.
√ Packages successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 61 dependencies.
Fetching dependency metadata from registry...
                  Package "@angular-eslint/builder" has an incompatible peer dependency to "@angular/cli" (requires ">= 11.2.0 < 12.0.0", would install "13.3.9").
                  Package "@angular-material-components/datetime-picker" has an incompatible peer dependency to "@angular/common" (requires "^11.1.0" (extended), would install "13.3.11").
                  Package "@angular-eslint/eslint-plugin" has an incompatible peer dependency to "@angular/compiler" (requires ">= 11.2.0 < 12.0.0" (extended), would install "13.3.11").
                  Package "@angular-material-components/datetime-picker" has an incompatible peer dependency to "@angular/core" (requires "^11.1.0" (extended), would install "13.3.11").
                  Package "@angular-material-components/datetime-picker" has an incompatible peer dependency to "@angular/forms" (requires "^11.1.0" (extended), would install "13.3.11").
                  Package "@angular-material-components/datetime-picker" has an incompatible peer dependency to "@angular/platform-browser" (requires "^11.1.0" (extended), would install "13.3.11").
× Migration failed: 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 11 的库。 Angular 12 仍然与它们兼容。 Angular 13 不再是。 过去我是这样处理这种情况的:

  1. 卸载那些引发错误的依赖项。
  2. 将 Angular 版本升级到 13。
  3. 安装这些依赖项及其适用于 Angular 13 的版本。
  4. 希望它可以编译并且这些依赖项没有任何重大更改。 如果他们确实修复了它们。
  5. 在将 Angular 版本从 13 升级到 14 时重复这些步骤。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM