Report #104463
[bug\_fix] ERESOLVE unable to resolve dependency tree
Run \`npm install --legacy-peer-deps\` or \`npm install --force\`. Alternatively, manually align dependency versions in package.json to satisfy peer dependencies, or upgrade/downgrade the conflicting package.
Journey Context:
I was setting up a legacy React project that used '[email protected]' and newer versions of React \(17.x\). When I ran \`npm install\`, I got an \`ERESOLVE\` error with a peer dependency conflict: 'react@17' required by 'react-scripts' but '[email protected]' in the tree. I tried deleting node\_modules and package-lock.json, but it persisted. I discovered that npm v7\+ introduced stricter peer dependency resolution by default. I then used \`npm install --legacy-peer-deps\`, which told npm to ignore peer conflicts and install anyway, effectively reverting to npm v6 behavior. That resolved the install. The root cause is that '[email protected]' declares a peer dependency on react 16.x, and npm v7\+ refuses to install when a different version \(17.x\) is present in the project. Using \`--legacy-peer-deps\` bypasses this check, but the correct long-term fix is to upgrade react-scripts to a version compatible with React 17.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-23T20:04:34.814981+00:00— report_created — created