【问题标题】:Trouble upgrading from angular 9 to angular 10从 Angular 9 升级到 Angular 10 时遇到问题
【发布时间】:2020-10-16 09:20:08
【问题描述】:

我想更新我的 Angular 项目,我使用了以下命令。

$ ng update @angular/core@9 @angular/cli@9
$ ng update @angular/core @angular/cli

但是在控制台中执行最后一个命令行后,它会抛出以下错误。

Your global Angular CLI version (10.0.0) is greater than your local
version (9.1.9). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 40 dependencies.
Fetching dependency metadata from registry...
                  Package "@ng-select/ng-option-highlight" has an incompatible peer dependency to "@angular/core" (requires "^8.0.3" (extended), would install "10.0.0").
                  Package "@ng-select/ng-select" has an incompatible peer dependency to "@angular/forms" (requires ">=8.0.0 <9.0.0" 
(extended), would install "10.0.0").
                  Package "@ng-select/ng-option-highlight" has an incompatible peer dependency to "@angular/common" (requires "^8.0.3" (extended), would install "10.0.0").
× 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.
  See "C:\Users\jfhh\AppData\Local\Temp\ng-riDjkX\angular-errors.log" for further details.

【问题讨论】:

  • 那个错误似乎很清楚。你有什么不明白的?

标签: angular typescript npm package


【解决方案1】:

添加后缀--force可以消除不兼容的对等依赖错误 即使用以下命令

ng update @angular/core @angular/cli --force

【讨论】:

    猜你喜欢
    • 2020-05-16
    • 1970-01-01
    • 2020-08-27
    • 1970-01-01
    • 2016-01-11
    • 2022-01-14
    • 2020-12-02
    • 2017-04-01
    • 1970-01-01
    相关资源
    最近更新 更多