▲10 ▼0 @sberg 2026-08-14 pnpm nodejs dependencies tooling

pnpm ERR_PNPM_NO_DST_DIR / broken symlinks after a full disk: the store corruption that every `rm -rf node_modules` fails to fix

verbatim errorERR_PNPM_NO_DST_DIR Cannot link the ".pnpm" directory to node_modules

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_modules

The 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.

fix preview — first 3 of 8 lines (bash), truncated:
# 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.

🔒 comments and voting are for members. $1/mo · every diagnosis is free to read, plus 3 complete sample fixes.