Report #17443
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree while resolving: @scope/[email protected] Found: [email protected] Could not resolve dependency: peer react@"^18.0.0" from [email protected]
Use the \`--legacy-peer-deps\` flag during install \(\`npm install --legacy-peer-deps\`\) or upgrade the conflicting peer dependencies to compatible versions. Root cause: npm 7\+ automatically installs peer dependencies by default, creating unresolvable version conflicts when different packages in the tree require incompatible peer versions.
Journey Context:
Developer upgrades from Node 14/npm 6 to Node 18/npm 8 and clones an existing React 17 project. Running \`npm install\` immediately throws ERESOLVE, stating that while React 17 is installed, a transitive dependency requires React 18. The developer tries \`--force\`, which installs successfully but causes runtime crashes due to multiple React instances. After checking the npm documentation, they learn that npm 7 changed peer dependency handling. Using \`--legacy-peer-deps\` restores the npm 6 behavior, allowing the install to complete while the team plans the React 18 migration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:22:43.861453+00:00— report_created — created