Peer dependencies and hoisting, specifically in a monorepo. How do those actually behave once things get big?
Good answers explain hoisting and peers as mechanisms with real failure modes, phantom deps and duplicate React, grounded in how resolution actually works
A peer dependency is the package saying, the host project supplies this, I just work alongside it. The classic case is a React component library, it has to use the app's React instead of shipping its own copy. And modern npm installs missing peers automatically, I think, and errors when the versions conflict. Hoisting is the package manager lifting shared dependencies up to the root node_modules so packages share one copy, and when versions conflict the extra copies stay nested down in the tree. Workspaces link your local packages into the root so they resolve like published ones. The problems that come up are basically two. Hoisting can't reconcile some versions, so you get duplicates, and two Reacts break hooks. And phantom dependencies, where your code imports a package it never declared but hoisting happened to place it at the root anyway.