Report #104692
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve npm ERR\! While resolving: [email protected] npm ERR\! Found: [email protected] npm ERR\! node\_modules/react npm ERR\! react@"18.2.0" from the root project npm ERR\! Could not resolve dependency: npm ERR\! peer react@"^17.0.0" from [email protected]
Update the conflicting library to a version that supports React 18, or use \`npm install --legacy-peer-deps\` as a temporary workaround. For permanent resolution, add an \`overrides\` field in package.json to force the peer dependency version: \`"overrides": \{ "some-library": \{ "react": "$react" \} \}\`.
Journey Context:
A developer was adding a popular charting library to a React 18 project. On running \`npm install\`, npm v7\+ threw an ERESOLVE error because the library declared a peer dependency on React ^17.0.0. The developer initially tried \`--legacy-peer-deps\` to bypass the check, which worked but left the project with potentially incompatible dependencies. After reading the npm documentation on peer dependencies and overrides, they discovered that the library had a newer version \(3.0.0\) that supported React 18. Updating the library to that version resolved the conflict cleanly. The environment was Node 18.16.0, npm 9.6.7, on macOS Ventura.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:10:33.176779+00:00— report_created — created