docs: recommend install-strategy=linked to catch phantom dependencies#9690
Merged
Conversation
…#9678) Encourages package authors to develop under `install-strategy=linked` to surface undeclared ("phantom") dependencies before publishing. Under the default hoisted `node_modules`, a package can `import` a dependency it never declared and still resolve it: a transitive dependency hoisted alongside it (or a workspace root's `node_modules`) happens to satisfy the import. That undeclared dependency passes the author's own build silently, then fails for a consumer who installs the package on its own. The linked (isolated) layout exposes only a package's declared dependencies, so such an import can fail at the author's build instead of shipping broken. The change documents this in two places: - The `install-strategy` entry in the config reference now recommends that authors use `--install-strategy=linked` during development, cross-linked to the developers guide. - The Developers guide gains a "Catching undeclared ("phantom") dependencies" section under "Before Publishing", with a note that this is one check — a dependency satisfied by a `devDependency` or a workspace root's `node_modules` can still resolve locally — alongside auditing the dependencies the published package actually uses. This is documentation-only; the config reference text is generated from the `install-strategy` definition description. ## References Closes #9675 (cherry picked from commit fdcfcee)
owlstronaut
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #9678 to
release/v11.