RFC: Global Virtual Store for Linked Installs#911
Open
manzoorwanijk wants to merge 1 commit into
Open
Conversation
manzoorwanijk
force-pushed
the
rfc-global-virtual-store
branch
from
July 11, 2026 11:40
a71ffeb to
ce1be39
Compare
manzoorwanijk
marked this pull request as ready for review
July 11, 2026 11:42
Contributor
Author
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.
Summary
Adds an RFC for an opt-in
global-virtual-storeconfig for projects usinginstall-strategy=linked. The projections thatlinkedwrites into each project'snode_modules/.store/move to a single machine-global store root; the project'snode_moduleskeeps only the symlinks (junctions on Windows) thatlinkedalready creates. Each globally eligible projection is extracted once per machine, so every additional project or git worktree resolving the same dependency subtree costs a few megabytes of symlinks and nearly zero install time.The proposal changes only
@npmcli/arboristand the npm CLI — no changes topacote,cacache,package-lock.json, the registry, ornpm publish.Motivation
Parallel coding agents have made git worktrees routine, and every worktree pays for a full
node_modulestoday (~2.2 GB and ~24 s per worktree measured on Gutenberg). pnpm shippedenableGlobalVirtualStorefor exactly this workload; a 2.5 GB production monorepo measured itsnode_modulesdrop to 1.4 MB. A machine-global store is also one of npm's most persistently requested features (#278, #409, #817, npm/cli#8242 — closed with a pointer to this repo; no RFC followed).With RFC 0042 shipped, the layout already exists: this RFC reparents the store root out of the project, keeping the projection key, the reifier, the symlink shape, and the lockfile unchanged.
Notable semantics
install-strategy=linked; errors under other strategies.linkedtoday. This is stricter than pnpm, which shares built projections (pnpm/pnpm#12302).node_modulesmust dereference or reinstall, and the store assumes a single trust boundary.A separate proposal, RFC: Content-Addressable Store (#912), covers file-level content-addressable storage for every install strategy; the two share a store root layout but neither depends on the other.
See the RFC for the full design, alternatives, implementation plan, tests, and unresolved questions.