从10到11的角更新给出了错误

发布于 2025-02-11 01:42:19 字数 3496 浏览 1 评论 0原文

实际项目是版本9。从版本9到10的升级成功完成。当我检查Angular版本ng V时,它将显示版本10,并且包装文件还使用版本10进行了更新。但是,从10升级到11时,我会给我以下错误。

运行以下命令以从版本10

ng Update @angular/core @11 @angular/cli @11 -force

获取以下错误

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 11.2.19 to perform the update.
✔ Package successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 31 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.1102.19" (was "0.1002.4")...
    Updating package.json with dependency @angular/cli @ "11.2.19" (was "10.2.4")...
    Updating package.json with dependency @angular/compiler-cli @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency karma @ "6.4.0" (was "5.0.9")...
    Updating package.json with dependency @angular/animations @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/common @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/compiler @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/core @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/forms @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/localize @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/platform-browser @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/router @ "11.2.14" (was "10.2.5")...
  UPDATE package.json (1331 bytes)
⠹ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: *****@0.0.0
npm ERR! Found: @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"~0.1102.19" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1102.19" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^11.0.0 || ^11.2.0-next" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.19" 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/****/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/*****/.npm/_logs/2022-06-28T06_25_22_421Z-debug-0.log
✖ Package install failed, see above.
✖ Migration failed. See above for further details.

ps:****是否与文件夹名称和项目名称有关

Actual project is of version 9. upgrade from version 9 to 10 is done successfully. when I checked the angular version ng v it is showing version 10 and package file is also updated with version 10. but while upgrading from 10 to 11 is giving me below error.

Running the below command to upgrade from version 10

ng update @angular/core@11 @angular/cli@11 --force

getting the below error

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 11.2.19 to perform the update.
✔ Package successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 31 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.1102.19" (was "0.1002.4")...
    Updating package.json with dependency @angular/cli @ "11.2.19" (was "10.2.4")...
    Updating package.json with dependency @angular/compiler-cli @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency karma @ "6.4.0" (was "5.0.9")...
    Updating package.json with dependency @angular/animations @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/common @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/compiler @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/core @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/forms @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/localize @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/platform-browser @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "11.2.14" (was "10.2.5")...
    Updating package.json with dependency @angular/router @ "11.2.14" (was "10.2.5")...
  UPDATE package.json (1331 bytes)
⠹ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: *****@0.0.0
npm ERR! Found: @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"~0.1102.19" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1102.19" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^11.0.0 || ^11.2.0-next" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.19" 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/****/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/*****/.npm/_logs/2022-06-28T06_25_22_421Z-debug-0.log
✖ Package install failed, see above.
✖ Migration failed. See above for further details.

ps: **** are some names related to folder name and project name

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只为守护你 2025-02-18 01:42:20

遵循它所说的;您已经在使用- 强制,但是您会发现有很多软件包迫使您需要- legacy-peer-deps flag也是如此。

两者都运行。

我已经升级了几个项目,现在几乎所有这些项目都需要旧版标志,因为许多二次没有更新。

Follow what it says; you're already using --force, but you'll find there are plenty of packages out there that force you in to needing the --legacy-peer-deps flag as well.

Run it with both.

I've upgraded several projects and now pretty much all of them need the legacy flag because so many deps just aren't updated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文