Report #58564
[bug\_fix] EXDEV: cross-device link not permitted, scandir '/app/node\_modules/...'
Configure pnpm to use a store path on the same filesystem as the project, or change the package import method to copy/clone instead of hardlink. Run \`pnpm config set store-dir /path/to/project/.pnpm-store\` or add \`package-import-method=clone\` to \`.npmrc\`. Root cause: pnpm uses hard links from a content-addressable store to node\_modules. If the store \(default ~/.local/share/pnpm\) is on a different partition/filesystem than the project \(e.g., Docker volume, NFS, separate mount\), hard linking fails with EXDEV.
Journey Context:
You are running pnpm install inside a Docker container where the project is mounted as a volume at /app but the home directory /root \(where pnpm stores its global store\) is on the container's overlayfs or a different volume. The install fails with 'EXDEV: cross-device link not permitted' when trying to link from /root/.local/share/pnpm/store to /app/node\_modules. You search and find that pnpm uses hard links by default. You check \`pnpm store path\` and see it's on a different filesystem than your project. You either move the store to the same volume \(\`pnpm config set store-dir /app/.pnpm-store\`\) or switch to cloning \(\`echo "package-import-method=clone" >> .npmrc\`\). After this, pnpm uses copies instead of hard links \(or links within the same device\), and the install succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:47:16.657680+00:00— report_created — created