我正在尝试将我的项目中的 Angular 从版本 10.2 更新到 11.0。运行 ng 更新:
@angular-devkit/build-angular 0.1002.0 -> 0.1100.1 ng update @angular-devkit/build-angular
@angular/cdk 10.2.7 -> 11.0.0 ng update @angular/cdk
@angular/cli 10.2.0 -> 11.0.1 ng update @angular/cli
@angular/core 10.2.3 -> 11.0.0 ng update @angular/core
@angular/material 10.2.7 -> 11.0.0 ng update @angular/material
不幸的是,我尝试更新的每个软件包都失败了。我尝试了 --force 和 --allowDirty 标志。
@角cli
npm ERR! Found: @angular-devkit/build-angular@0.1002.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.0.0
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^11.0.0 || ^11.0.0-next" from @angular-devkit/build-
angular@0.1100.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
@angular-devkit/build-angular
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @angular-devkit/build-angular@0.1002.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.0.0
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^11.0.0 || ^11.0.0-next" from @angular-devkit/build-angular@0.1100.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
@角/材料
Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! Cannot read property 'length' of undefined
@角/cdk
Found: @angular-devkit/build-angular@0.1002.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.0.0
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^11.0.0 || ^11.0.0-next" from @angular-devkit/build-
angular@0.1100.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root project
更新按特定顺序安装后,我设法更新,但现在 NPM 不会安装,并给出以下消息:
Found: @angular-devkit/build-angular@0.1002.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root
project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the root
project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.0.0
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^11.0.0 || ^11.0.0-next" from
@angular-devkit/build-angular@0.1100.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1100.1" from the
root project