You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] install-strategy=linked: .store and stale directories not cleaned up when switching install strategy #9615
This is not just a request to bump a dependency for a CVE
This is not solely a request to bump a dependency for a CVE
Current Behavior
Switching the install strategy in the same project directory leaves stale state in both directions. Switching hoisted → linked leaves the previous strategy's real top-level transitive directories (e.g. balanced-match, brace-expansion, concat-map) on disk alongside the new .store/ and symlinks. Switching linked → hoisted leaves the entire node_modules/.store/ directory behind. A fresh install of either strategy produces a clean layout.
Expected Behavior
Switching strategy should remove the layout artifacts of the previous strategy: stale top-level real directories should be cleaned up when entering the linked strategy, and .store/ should be removed when leaving it.
Steps To Reproduce
cd"$(mktemp -d)"echo'{ "name": "sw", "version": "1.0.0", "dependencies": { "minimatch": "3.0.4" } }'> package.json
echo'install-strategy=hoisted'> .npmrc
npm install >/dev/null # real dirs: balanced-match, brace-expansion, concat-map, minimatchecho'install-strategy=linked'> .npmrc
npm install >/dev/null
ls -l node_modules | grep -E 'balanced-match|brace-expansion|concat-map'# still real dirs (stale)# a fresh linked install has only `minimatch` (symlink) + .store/# reverse direction:echo'install-strategy=hoisted'> .npmrc
npm install >/dev/null
ls node_modules/.store # still present (stale); a fresh hoisted install has no .store
Activity
fix(arborist): clean up stale .store and hoisted dirs on strategy swi…