Short answer
Read the Found and Could not resolve dependency lines: they name the package whose peer range is too old (or too new) for what you have. Upgrade that package to a release that supports your version, or pick versions that satisfy both ranges. If no compatible release exists and you have checked it works, pin the peer with overrides in package.json. Use --legacy-peer-deps only as a last resort, and never --force as a habit.
Which packages disagree, and the fix
01
A package with an outdated peer range
The usual case: you upgraded React, Next.js, ESLint or TypeScript, and a plugin still declares a peer range for the old major version. Check whether a newer version of that plugin exists, and upgrade it.
npm view some-package peerDependencies npm install some-package@latest02
No compatible release yet: overrides
“Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely.” npm Docs, package.json: overrides
If the plugin works with your version but has not updated its range, override the peer for that package in the root package.json, then run a clean install and test. The "$react" value reuses the react version your root package.json already declares, so react must be listed there.
{ "overrides": { "some-package": { "react": "$react" } } }03
--legacy-peer-deps, and why it is a last resort
“Use of legacy-peer-deps is not recommended, as it will not enforce the peerDependencies contract that meta-dependencies may rely on.” npm Docs, npm config: legacy-peer-deps
It makes npm behave like npm 6 and skip peer dependencies entirely, so the install succeeds even when versions really are incompatible. If you use it, put it in .npmrc so every machine and CI install the same tree, and plan to remove it.
# .npmrc legacy-peer-deps=true04
It works locally but fails in CI or on Vercel
A local node_modules or an .npmrc on your machine can hide the conflict. Delete node_modules, run npm ci (which installs exactly what the lockfile says), and commit the lockfile and any .npmrc the project needs.
Checked against the vendor’s docs on : npm Docs: config (legacy-peer-deps); npm Docs: package.json (overrides).
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: Vercel “npm run build exited with 1” · npm and pnpm “ELIFECYCLE” · npm “EACCES: permission denied”