Cause 1 of 5
A dependency has not been updated for your major version of the peer.
Read the block npm prints — it names the package, what it found, and what it wants. Then upgrade that package to a release that lists your version as a valid peer; npm view <package> peerDependencies and the changelog tell you which release that is.
Cause 2 of 5
You control the peer's version and can align it instead.
If the conflict is over a library your own project pins, install a version every dependent accepts. Downgrading one direct dependency is often cleaner than forcing the tree.
Cause 3 of 5
The tree is stale rather than genuinely conflicting.
Delete node_modules and package-lock.json and run npm install so npm re-solves from scratch. Regenerate the lockfile — do not delete it permanently; it is what makes installs reproducible.
Cause 4 of 5
Nothing compatible exists yet and you have checked the mismatch is cosmetic.
npm install --legacy-peer-deps installs anyway and ignores peer ranges. This can produce a tree that genuinely breaks at runtime, so test the affected feature deliberately, record the flag in .npmrc so CI matches local exactly, and remove it once the package updates. Prefer it over --force, which is broader and overrides more checks.
Cause 5 of 5
You need a single version of a peer that npm has duplicated.
overrides in package.json forces one resolution across the whole tree. It is powerful and easy to get wrong, so scope it to the exact package and check npm ls <name> shows a single copy afterwards.