从 Angular 10 升级到 11 时出错
Getting error when upgrading from Angular 10 to 11
我正在尝试从 Angular 10 升级到 11。当我 运行 以下命令时,出现错误。
ng update @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.
尝试在命令中添加 --force
参数并忽略警告。
ng update @angular/core@11 @angular/cli@11 --force
我正在尝试从 Angular 10 升级到 11。当我 运行 以下命令时,出现错误。
ng update @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.
尝试在命令中添加 --force
参数并忽略警告。
ng update @angular/core@11 @angular/cli@11 --force