将Angular应用程序从版本10.2更新到11.0时出错

将Angular应用程序从版本10.2更新到11.0时出错,angular,Angular,我正在尝试更新我的角度项目。我在过去已经多次这样做了,效果很好。但是从10.2版到11.0版,当运行指南中的第一个更新命令(update.angular.io)时,我正确地得到了这个错误: 这就是错误: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: @angular-devkit/build-angular@0.1002.3 npm ERR!

我正在尝试更新我的角度项目。我在过去已经多次这样做了,效果很好。但是从10.2版到11.0版,当运行指南中的第一个更新命令(update.angular.io)时,我正确地得到了这个错误:

这就是错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: @angular-devkit/build-angular@0.1002.3
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"~0.1102.14" from the root project
npm ERR!   peer @angular-devkit/build-angular@">=0.900.0" from ngx-build-plus@10.1.1
npm ERR!   node_modules/ngx-build-plus
npm ERR!     dev ngx-build-plus@"^10.1.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1102.14" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/compiler-cli@11.2.14
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^11.0.0 || ^11.2.0-next" from @angular-devkit/build-angular@0.1102.14
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.14" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/michael/.npm/eresolve-report.txt for a full report.

有没有人经历过这个错误并且知道如何处理它?不幸的是,我有点无助。

对我来说,问题是代码编辑器是打开的

关闭编辑器并运行
ng update@angular/core@angular/cli
angular成功更新


否则,请尝试以下操作:

* Delete node_modules and package-lock.json
* npm cache clean --force
* npm i --force
在发布错误消息之后的“npm安装--遗留对等deps”就是关键所在。它帮助我继续我的角度更新从10.2到11,然后到12


该项目之后没有问题。

您尝试过使用
--force
选项吗?@GaëlJ我并不急于尝试使用force。我遇到了“npm安装——遗留对等DEP”,这对我很有帮助,但我认为我的配置中仍然存在一些问题。谢谢,不幸的是,它没有解决问题npm安装——遗留的对等DEP帮助了我,但我想我的配置中仍然存在一些问题。
* Delete node_modules and package-lock.json
* npm cache clean --force
* npm i --force