Report #104268
[bug\_fix] pnpm: \`ERR\_PNPM\_PEER\_DEP\_ISSUES Unmet peer dependencies\` or \`Cannot resolve package\`
Add the missing peer dependencies explicitly in the project's \`package.json\` or use pnpm's \`pnpm.peerDependencyRules.allowedVersions\` and \`pnpm.peerDependencyRules.allowAny\` in \`package.json\`. Alternatively, set \`strict-peer-dependencies=false\` in \`.npmrc\`.
Journey Context:
A developer working on a monorepo with pnpm v7 added a package that depends on \`react@^17\` and \`react-dom@^17\`, but the workspace's root package.json already had \`react@18\` as a dependency. pnpm's strict peer dependency check refused to install because \`react@18\` did not satisfy the peer version \`^17\`. The developer attempted \`pnpm install --no-strict-peer-dependencies\` which worked but warned. To fix permanently, they added an entry to \`package.json\`: \`"pnpm": \{ "peerDependencyRules": \{ "allowedVersions": \{ "react": "18" \} \} \}\`. This allowed pnpm to treat the satisfied version as acceptable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:02:41.997600+00:00— report_created — created