user14451038
user14451038

Reputation:

Angular update returns a dependency error

I'm trying to update my angular project, and ng update @angular/core drops the following error:

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/[email protected]
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 returns the same error.

I've tried to install @angular/[email protected] manually, but it returns the same error.

What should I do?

Thank for the advices in advance!

Upvotes: 2

Views: 2271

Answers (1)

SeleM
SeleM

Reputation: 9638

Try:

npm install --legacy-peer-deps

Upvotes: 5

Related Questions