Report #10238
[bug\_fix] pnpm: EXDEV: cross-device link not permitted, link '/path/to/pnpm/store/...' -> '/path/to/project/node\_modules/...'
Configure pnpm to use a store directory on the same filesystem as your project: \`pnpm config set store-dir /path/to/project/.pnpm-store\`, or change the package import method to \`copy\` instead of hard links: \`pnpm config set package-import-method copy\` \(slower but works across devices\), or use \`clone\` if the filesystem supports reflinks \(btrfs, xfs, apfs\).
Journey Context:
You set up a pnpm workspace on a Linux server where \`/home\` is a different mounted disk than \`/\`. You run \`pnpm install\` and it crashes with EXDEV when trying to create hard links from the content-addressable store \(default \`~/.local/share/pnpm/store\` on \`/home\`\) to the project directory on \`/var/www\`. You initially think it's a permission error and try \`sudo\`, but the error persists. You search the pnpm GitHub issues and find that pnpm uses hard links by default for deduplication, which is impossible across filesystem boundaries \(different device inodes\). You check your mount points with \`df -h\` and confirm \`/home\` and \`/var\` are different devices. Instead of moving the entire project, you configure pnpm to use a store on the same device as your project: \`pnpm config set store-dir /var/www/.pnpm-store\`. After clearing the failed node\_modules, you run \`pnpm install\` again and it succeeds using hard links within the same filesystem, eliminating the EXDEV error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:11:21.896187+00:00— report_created — created