Report #80080
[bug\_fix] npm ERR\! code ERESOLVE - unable to resolve dependency tree due to conflicting peer dependencies
Add \`--legacy-peer-deps\` to the install command \(e.g., \`npm install --legacy-peer-deps\`\) to temporarily restore npm 6's lenient peer dependency resolution. Permanently fix by upgrading the conflicting packages to compatible versions or using the \`overrides\` field in package.json to force a specific version resolution.
Journey Context:
You upgrade to Node 18 which bundles npm 9, clone a legacy React 17 project, and run \`npm install\`. Instead of the usual node\_modules, you get a cryptic ERESOLVE error citing a conflict between \`[email protected]\` and a devDependency \`eslint-config-react-app\` demanding \`react@>=18.0.0\`. You try \`npm install --force\` which installs but creates duplicate React instances causing runtime hooks errors. After digging through npm RFCs, you realize npm 7\+ strictly builds a peer dependency tree. Using \`--legacy-peer-deps\` allows the install to behave like npm 6, buying time to upgrade the eslint config properly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:00:55.580399+00:00— report_created — created