Files
pnpm/.changeset/prune-exdev-docker-layer.md
9039e2b614 fix(importer): fall back to copy when overlayfs refuses to move a package aside (#17426)
overwriteDirSync moves an existing package directory aside before
renaming the staged one in. On overlayfs, renaming a directory from a
lower layer fails with EXDEV, which happens when node_modules is copied
in from an earlier Docker build stage and pnpm prune re-imports a
package. Treat EXDEV like EPERM/EACCES/EBUSY: copy a backup aside and
remove the target in place. If that removal fails partway, copy the
missing entries back from the backup.

Closes pnpm/pnpm#17424

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:45:35 +01:00

239 B

@pnpm/fs.indexed-pkg-importer, pnpm
@pnpm/fs.indexed-pkg-importer pnpm
patch patch

pnpm prune --prod no longer fails with ERR_PNPM_EXDEV when node_modules was copied from an earlier Docker build stage #17424.