Does pnpm fallback to copying files when the store and project reside on different partitions?
0 reputation · 15 Jan 2024, 11:40 UTC
Hard-linking Constraints Across Volumes
pnpm utilizes a content-addressable store to minimize disk usage by creating hard links from the global store to the project's node_modules. This mechanism relies on the underlying filesystem's ability to reference the same inode across directories.
In environments where the pnpm store is configured on a separate physical drive or a different logical partition than the project workspace, the standard hard-linking mechanism may be restricted by operating system limitations, as hard links typically cannot span multiple volumes.
When this cross-volume boundary is encountered, it is unclear how pnpm manages the trade-off between installation speed and disk efficiency.
- Does pnpm automatically detect the volume mismatch and fallback to copying files?
- If copying is triggered, is this behavior logged or configurable to prevent unexpected disk bloat?
- Are there alternative linking strategies available for cross-volume setups in current versions?