Choosing pnpm’s Package Hoisting Strategy: Strict, Shamefully‑hoist, or Selective
Learn how to pick the right pnpm hoisting mode for your Node.js project, compare disk usage and compatibility, and apply the setting with verification steps.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to pick the right pnpm hoisting mode for your Node.js project, compare disk usage and compatibility, and apply the setting with verification steps.
Npm workspaces provide a convenient way to manage monorepos, automatically hoisting dependencies to the root node_modules where possible. However, when two workspace packages depend on different versions of the same transitive dependency, the client must decide where to place that dependency. The algorithm that drives this decision is documented in the npm w
Dependency Resolution and Hoisting in pnpm pnpm utilizes a content-addressable store and a non-flat node_modules layout to prevent phantom dependencies. By default, only direct dependencies are accessible at the root of node_modules , while transitive dependencies are isolated within the .pnpm virtual store. However, certain legacy tools and bundlers expect