Angular 角度更新返回一个依赖项错误

Angular 角度更新返回一个依赖项错误,angular,npm,Angular,Npm,我正在尝试更新我的angular项目,ng update@angular/core会出现以下错误: Using package manager: 'npm' Collecting installed dependencies... Found 41 dependencies. Fetching dependency metadata from registry... Updating package.json with dependency @angular/compiler-cli @

我正在尝试更新我的angular项目,ng update@angular/core会出现以下错误:

Using package manager: 'npm'
Collecting installed dependencies...
Found 41 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular/compiler-cli @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/animations @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/common @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/compiler @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/core @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/platform-browser @ "11.0.7" (was "10.1.6")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "11.0.7" (was "10.1.6")...
  UPDATE package.json (1654 bytes)
| Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @angular/animations@10.1.6
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"^11.0.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @angular/animations@"^11.0.7" 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 C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2021-01-11T15_58_29_106Z-debug.log
× Package install failed, see above.
× Migration failed. See above for further details.
ng update@angular/core--force
返回相同的错误

我已尝试安装
@angular/animations@11.0.7
手动,但返回相同的错误

我该怎么办

提前感谢您的建议

试试看:

npm安装--旧式对等DEP

尝试:

npm安装--旧式对等DEP


您是否尝试过npm安装--旧式对等deps?我现在就尝试了。现在我不再看到错误,但是
ng update
仍然显示@angular/core仍然在10.1.6上。如果我再次运行
ng update@angular/core
,它会说它是最新的,但再次运行ng update将显示相同的10.1.6版本。--尝试
ng更新@angular/core@11.0.7
(如果您想要该版本),根据更新命令,它已经在该版本上。但是运行
ng update
显示它仍然在10.1.6上。。。我不明白您是否尝试过
npm安装--legacy peer deps
?我现在就尝试了。现在我不再看到错误,但是
ng update
仍然显示@angular/core仍然在10.1.6上。如果我再次运行
ng update@angular/core
,它会说它是最新的,但再次运行ng update将显示相同的10.1.6版本。--尝试
ng更新@angular/core@11.0.7
(如果您想要该版本),根据更新命令,它已经在该版本上。但是运行
ng update
显示它仍然在10.1.6上。。。我不明白