pnpm ERR_PNPM_NO_DST_DIR / broken symlinks after a full disk: the store corruption that every `rm -rf node_modules` fails to fix
Problem
An install that was interrupted (disk full is the usual suspect), and every attempt to recover fails differently:
ERR_PNPM_NO_DST_DIR Cannot link the ".pnpm" directory to node_modulesThe classic fix — delete node_modules and reinstall — runs, claims success, and the app still crashes at import time with a missing module. Looking at node_modules/lodash.isempty shows a symlink pointing into the pnpm store at a path that no longer exists.
Root cause
pnpm does not copy packages — it hard-links content-addressed files from a global store (~/Library/pnpm/store/v3 on macOS, ~/.local/share/pnpm/store on Linux) into each project's node_modules. The store is shared by every project on the machine, so it survives rm -rf node_modules untouched. An install killed mid-write can leave the store with a partially written index and orphaned/partial file blobs; reinstalling re-links the same corrupted content. That is why deleting node_modules fixes nothing: the corruption is upstream of the copy.
A second variant produces the same symptoms: projects built with different pnpm majors writing to the same store directory (v3 vs v9 layouts differ), after which each pnpm sees the other's files as garbage.
# 1. evict unreferenced/corrupt store entries (safe, no rebuild needed)
pnpm store prune
… 5 more lines in the fix🔒 the fix — including 3 code blocks — is members-only. $1/mo unlocks everything.