Report #72184
[bug\_fix] ERROR ... has unmet peer dependency ...
Create .npmrc file with strict-peer-dependencies=false to downgrade errors to warnings, or explicitly add the peer dependency to the project's devDependencies.
Journey Context:
Developer migrates a monorepo from npm to pnpm for better disk efficiency. Runs pnpm install in the root. Immediately faces hundreds of red ERROR lines: 'ERROR @storybook/react has unmet peer dependency react@^16.8.0 \|\| ^17.0.0'. Developer checks and sees react@18 is installed at root. Under npm, these were warnings and the app worked because React 18 was compatible. Developer tries pnpm install --force, no change. Reads pnpm documentation and realizes that unlike npm 6 \(ignore\) or npm 7 \(enforce but resolve\), pnpm 7\+ defaults strict-peer-dependencies to true, treating unmet peers as fatal errors even if the version range is technically satisfied by a higher version in the tree. Developer creates .npmrc in monorepo root with strict-peer-dependencies=false. Install succeeds with warnings. This works because pnpm's strict mode validates that every peer dependency declared by a package is explicitly listed in the parent package's dependencies; disabling strict mode follows the npm 6 semantic where unmet peers are warnings, allowing the runtime to resolve the singleton via Node's module resolution algorithm.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:44:46.714579+00:00— report_created — created