npm cannot pick a compatible set of dependencies because peer requirements conflict. Align versions (or upgrade both sides) and reinstall.
Fixes npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! peer dep missing
npm install react@17 react-dom@17
# or upgrade plugin to support React 18
npm install some-plugin@latestnpm install react@17 react-dom@17# or upgrade plugin to support React 18npm install some-plugin@latestnpm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency treenpm ERR! peer dep missing
npm v7+ enforces peer dependencies strictly. When two packages demand incompatible peer versions (e.g., plugin wants React 17 while you installed React 18), the resolver aborts with ERESOLVE and shows a conflict tree.
npm prints the conflicting packages. Read the requested vs installed versions to identify which pair is incompatible.
Pick compatible versions (upgrade/downgrade both). Example for React:
npm install react@17 react-dom@17
# or upgrade plugin to support React 18
npm install some-plugin@latestAfter adjusting versions, reinstall to refresh the lockfile:
rm -rf node_modules package-lock.json
npm installIf you must force a version, add an override in package.json:
{
"overrides": {
"some-plugin/react": "18.0.0"
}
}Re-run npm install. Test carefully because forced peers may break runtime.
Avoid --legacy-peer-deps as a long-term fix; it skips peer validation and can hide real incompatibilities. Prefer aligning the ecosystem on the same major version.