# TL;DR

Make the override and the installed versions agree on one major: either bump the react override to 19 or pin react-dom to 18, then reinstall. Overrides force a version across the whole tree, so overriding react to 18 while react-dom sits at 19 creates a contradiction npm refuses to resolve. Read the EOVERRIDE message - it tells you exactly which two versions collide.

## Error

```text
"npm ERR! code EOVERRIDE: Override for react@18 conflicts with react-dom@19"
```

## Steps

1. Read the full EOVERRIDE error. It names the override entry and the installed package version that conflicts with it. Expected: you see "Override for react@18" conflicting with the react-dom@19 in the tree.
2. Decide which major wins. Check what the rest of the tree needs: if the ecosystem (testing library, design system) is on 19, bump the override; if the app is on 18, pin react-dom. Expected: one consistent major chosen deliberately.
3. Edit the overrides. In package.json, change the overrides entry so react and react-dom resolve to the same major. Expected: the overrides block no longer contradicts the installed versions.
4. Reinstall. Run `npm install`. Expected: exit code 0, no EOVERRIDE.
5. Verify the tree. Run `npm ls react react-dom`. Expected: both resolve to the chosen major with no dedupe warnings or conflicts.

## Use this when

- npm install fails with code EOVERRIDE after adding or editing overrides
- Paired packages (react/react-dom, vue/vue-router) end up on different majors
- An agent added an override to fix one conflict and created another
- You need to understand what an overrides entry is actually forcing

## Not for this skill when

- The error is ERESOLVE, not EOVERRIDE - that is a peer conflict, different fix
- The override is intentional and the conflict is elsewhere - read the error carefully
- You want to remove overrides entirely - delete the block and reinstall

## Variant phrasings

- npm override conflicts with installed version
- EOVERRIDE error after adding npm overrides
- npm ERR code EOVERRIDE react version mismatch
- overrides entry contradicts dependency tree

## Why it happens

The overrides field tells npm "no matter what any package asks for, install this version." That is a blunt instrument: it applies tree-wide, including to packages that must move in lockstep like react and react-dom. When the override pins one half of a pair and the other half was installed at a different major, npm detects the contradiction and fails rather than producing a broken tree.

## Edge cases

- Overrides apply to transitive dependencies too - an override for react@18 also forces every nested copy, which can break packages that genuinely need 19.
- If you only want to override a specific nested path, use the nested override syntax naming the parent package followed by the child package, instead of a top-level entry.
- After changing overrides, delete node_modules and reinstall cleanly - stale nested copies can linger and confuse the verification.
- Document why each override exists (a comment in package.json or a linked issue) so the next agent does not remove it and reintroduce the original bug.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_sl5GGmGV9BerqMlLOrmaEA
