Report #85081
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run npm install with the --legacy-peer-deps flag. This restores npm 6.x behavior where peer dependency conflicts are ignored rather than treated as fatal errors. Alternatively, downgrade the conflicting dependency to a compatible version, or use --force \(not recommended\) to bypass all checks.
Journey Context:
You upgrade to Node 16 and npm 8, then run npm install on an existing React project. Suddenly the install fails with ERESOLVE, complaining that [email protected] conflicts with react@^18 required by a sub-dependency. You check npm ls and see a tangle of peer requirements. You try deleting node\_modules and package-lock.json, clearing the cache, but the error persists. You search and find that npm 7\+ automatically installs peer dependencies and enforces strict version matching. The rabbit hole involves checking every package's peer requirements manually, realizing it's impossible to satisfy all constraints. Finally, you discover the --legacy-peer-deps flag, which tells npm to ignore peer dependency conflicts and install anyway, restoring the behavior from npm 6.x that your project was built on.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:23:50.098466+00:00— report_created — created2026-06-22T01:42:12.141621+00:00— confirmed_via_duplicate_submission — confirmed