fix: disable global virtual store during pnpm deploy (#10577)

This commit is contained in:
Brandon Cheng
2026-02-10 20:19:43 -05:00
committed by Zoltan Kochan
parent c02513b58b
commit 4794c61dd1
4 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
---
"@pnpm/plugin-commands-installation": patch
"@pnpm/plugin-commands-deploy": patch
pnpm: patch
---
When the [`enableGlobalVirtualStore`](https://pnpm.io/settings#enableglobalvirtualstore) option is set, the `pnpm deploy` command would incorrectly create symlinks to the global virtual store. To keep the deploy directory self-contained, `pnpm deploy` now ignores this setting and always creates a localized virtual store within the deploy directory.

View File

@@ -285,6 +285,7 @@ export type InstallCommandOptions = Pick<Config,
| 'deployAllFiles'
| 'depth'
| 'dev'
| 'enableGlobalVirtualStore'
| 'engineStrict'
| 'excludeLinksFromLockfile'
| 'frozenLockfile'

View File

@@ -59,6 +59,7 @@ export type InstallDepsOptions = Pick<Config,
| 'dedupePeerDependents'
| 'depth'
| 'dev'
| 'enableGlobalVirtualStore'
| 'engineStrict'
| 'excludeLinksFromLockfile'
| 'global'

View File

@@ -168,6 +168,9 @@ export async function handler (opts: DeployOptions, params: string[]): Promise<v
// the deploy directory. It's also just weird to include empty importers
// that don't matter to the filtered lockfile generated for pnpm deploy.
pruneLockfileImporters: true,
// The node_modules for a pnpm deploy should be self-contained. The global
// virtual store would create symlinks outside of the deploy directory.
enableGlobalVirtualStore: false,
depth: Infinity,
hooks: {
...opts.hooks,
@@ -257,6 +260,9 @@ async function deployFromSharedLockfile (
allProjectsGraph: undefined,
selectedProjectsGraph: undefined,
rootProjectManifest: deployFiles.manifest,
// The node_modules for a pnpm deploy should be self-contained. The global
// virtual store would create symlinks outside of the deploy directory.
enableGlobalVirtualStore: false,
rootProjectManifestDir: deployDir,
dir: deployDir,
lockfileDir: deployDir,