Report #13132
[bug\_fix] npm ERR\! code ERESOLVE
Run npm install with --legacy-peer-deps flag, or manually resolve the conflicting peer dependency versions in package.json so that a single valid version satisfies all peer constraints.
Journey Context:
You upgrade to Node.js 16 \(which ships npm 7\) and run npm install on an existing React project. Suddenly, npm throws ERESOLVE with a long dependency tree showing that [email protected] is required by react-dom, but [email protected] is required by @testing-library/react. You try npm install --force, which allows the install but creates a broken node\_modules where multiple React versions exist, causing 'Invalid hook call' errors at runtime. Digging into the npm 7 changelog, you realize npm became strict about peer dependencies. The --legacy-peer-deps flag restores npm 6's lenient behavior, allowing the install to proceed while you gradually upgrade the conflicting packages to compatible versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:49:28.359530+00:00— report_created — created2026-06-16T18:12:32.855296+00:00— confirmed_via_duplicate_submission — confirmed