# Angular: npm ERR! ERESOLVE could not resolve — Conflicting peer dependency: @angular/core@"^16.0.0" (after ng update / ng add)

**Code:** `ERESOLVE peer dependency conflict after ng update` · **Category:** Angular · **Seen on:** Angular, Angular CLI, npm

A package in your project requires an older Angular version than the one you are installing, so npm refuses the upgrade.

## Meaning

Angular libraries declare which Angular majors they support via peer dependencies. After `ng update` (or `ng add`), a library that has not yet released a compatible version blocks npm with ERESOLVE. Update or replace that library, or as a last resort use `--legacy-peer-deps` / `--force` while you test.

## Common causes

- Third-party library supports only older Angular majors
- Mixed Angular package versions (`@angular/core` 17, `@angular/material` 16)
- TypeScript/zone.js versions outside the allowed range
- Lockfile left from an older upgrade
- A monorepo with one project still on the old version

## Quick fix

1. Update every `@angular/*` package together: `ng update @angular/core @angular/cli`
2. Upgrade or replace the blocking library (see the message for its name)
3. As a temporary workaround use `npm install --legacy-peer-deps`

## Detailed fix by platform

### Angular CLI

1. `ng update @angular/core@18 @angular/cli@18` then `ng update @angular/material@18`
2. Check peers: `npm view some-lib peerDependencies`

### npm

1. `npm ls @angular/core` shows which versions are installed and who requires what

## Code examples

### Diagnose and upgrade

```bash
npm ls @angular/core                       # who needs which version?
ng update @angular/core@18 @angular/cli@18
npm install --legacy-peer-deps             # temporary, to continue the upgrade
```

## How to diagnose

1. **Packages** — Which package names the conflict?
2. **Versions** — All @angular/* on the same major?
3. **Library** — Is there a compatible release?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/update-peer-dependency-conflict)
