Report #11468
[bug\_fix] ERR\_PNPM\_PEER\_DEP\_MISSING / Cannot find module in pnpm monorepos despite package being installed
Add shamefully-hoist=true to .npmrc in the project root to hoist dependencies like npm, or explicitly install the missing peer dependencies in the host package, or use pnpm.peerDependencyRules.auto-install-peers=true in .npmrc.
Journey Context:
Developer migrates an existing React project from npm to pnpm to save disk space. Deletes node\_modules and package-lock.json, runs pnpm install which completes successfully. Runs pnpm start, app immediately crashes with 'Error: Cannot find module react'. Checks node\_modules, sees react is symlinked from .pnpm folder but not at top level. Reads pnpm docs, learns pnpm doesn't hoist peer dependencies by default like npm does. Creates .npmrc file with shamefully-hoist=true, deletes node\_modules, reinstalls, app works. Later refactors to properly declare peer deps instead of hoisting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:22:24.340420+00:00— report_created — created