我正在关注此站点并尝试通过以下命令将我的项目更新到 11.0。
npx @angular/cli@11 update @angular/core@11 @angular/cli@11
每次我运行它时,它都会给我以下错误:
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: my-first-app@0.0.0
npm ERR! Found: @angular-devkit/build-angular@0.1002.4
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1102.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1102.17" from the root project
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.17
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1102.17" from the root project
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 install --legacy-peer-deps
我不确定上述命令如何提供帮助,因为我已经运行npm install并且现在只是尝试升级npx @angular/cli@11 update @angular/core@11 @angular/cli@11
环境细节:
Global Angular CLI: 13.1.2
Local Angular CLI: 10.2.4
Angular version: 10.2.5
Node: 16.13.1
我可以做些什么来让它发挥作用?