【发布时间】:2021-07-13 18:30:07
【问题描述】:
我正在尝试从 Angular 10 升级到 11。当我运行以下命令时,出现错误。
ng 更新@angular/core@11 @angular/cli@11
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 44 dependencies.
Fetching dependency metadata from registry...
Package "@angular-devkit/build-angular" has an incompatible peer dependency to
"typescript" (requires "~4.0.0 || ~4.1.0", would install "4.3.5")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=4.0 <4.2", would install "4.3.5")
× 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\DEFAUL~1.DES\AppData\Local\Temp\ng-13szno\angular-errors.log" for further details.
我不确定错误是什么。我查看了 package.json 文件,我已经有了 typescript 4.3.5。
【问题讨论】:
-
尝试运行
ng update并包含--force参数。我这样做的经验很好。 -
@R.Richards 我在想,但在别处读到这不是最好的做法。无论如何,我继续尝试。之后出现了一些问题,但可能与使用 --force 标志无关。谢谢。
标签: angular typescript upgrade