Report #74855
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_ISSUES \(pnpm strict peer dependencies\)
Add the missing peer dependencies explicitly to the project's devDependencies or dependencies in package.json, or create an .npmrc file in the project root with strict-peer-dependencies=false to disable the strict checking \(matching npm/yarn behavior\).
Journey Context:
Developer migrates an existing React project from npm to pnpm by running pnpm import then pnpm install, or enables pnpm in a monorepo. The installation fails immediately with ERR\_PNPM\_PEER\_DEP\_ISSUES, listing multiple 'Unmet peer dependencies' such as 'react@^17.0.0' required by '[email protected]' while the project has React 18 installed. The developer is confused because the project ran fine with npm and React 18 is backward compatible for their use case. They check node\_modules and see React 18 is present. They try adding the legacy peer deps to package.json but the error persists for different packages. The debugging rabbit hole leads to pnpm's documentation revealing that unlike npm \(which auto-installs peers since v7\) or Yarn \(which hoists loosely\), pnpm defaults to strict-peer-dependencies=true in recent versions. This means every peer dependency declared by any package must be explicitly satisfied by the project's direct dependencies, and pnpm creates a strict isolated module graph where packages cannot access undeclared peers. The developer realizes that the legacy react-router-dom strictly declares React 17 as a peer, and even though React 18 is installed, pnpm considers the peer unmet because the versions don't satisfy the range exactly. The fix of adding strict-peer-dependencies=false to .npmrc disables this strict enforcement, allowing the install to proceed with warnings \(matching npm behavior\). Alternatively, adding the specific React version to devDependencies explicitly satisfies the peer check while keeping strict mode enabled, ensuring the dependency graph is explicitly declared as pnpm requires.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:14:19.753032+00:00— report_created — created