Report #4293
[bug\_fix] pnpm hardlink ENOENT after moving project directory
Run \`pnpm install --force\` to recreate the hardlinks from the content-addressable store, or configure \`package-import-method=copy\` in \`.npmrc\` to avoid hardlink issues on cross-device filesystems.
Journey Context:
Developer clones a monorepo to their laptop's internal SSD and runs \`pnpm install\`. Everything works. They later move the project folder to an external USB drive or a network share to free up space. When they run \`pnpm install\` again or try to start the dev server, they get \`ENOENT: no such file or directory, realpath '/project/node\_modules/.pnpm/[email protected]/node\_modules/lodash'\`. The files appear to exist in the file explorer but Node can't read them. The developer learns that pnpm uses hardlinks from a global content-addressable store \(usually in ~/.local/share/pnpm/store or AppData\). When the project is moved to a different filesystem \(different partition, external drive, or Docker volume\), the hardlinks break because inode references are invalid. The \`pnpm install --force\` command recreates these links relative to the new location or copies the files if hardlinking isn't possible.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:10:58.445153+00:00— report_created — created