Skip to content

Toggling enableGlobalVirtualStore off is ignored — pnpm says "Already up to date" without reinstalling #12142

Description

@aqeelat

Reproduction

  1. Add enableGlobalVirtualStore: true to pnpm-workspace.yaml
  2. Run pnpm install — dependencies are installed (virtual store at <storeDir>/links)
  3. Remove enableGlobalVirtualStore: true from pnpm-workspace.yaml
  4. Run pnpm installexpected: deps reinstalled with local virtual store (node_modules/.pnpm) — actual: pnpm prints "Already up to date" and does nothing

Root cause

enableGlobalVirtualStore is missing from WORKSPACE_STATE_SETTING_KEYS in workspace/state/src/types.ts. The optimisticRepeatInstall fast path in installDeps calls checkDepsStatus before mutateModules. Since the workspace state file never recorded enableGlobalVirtualStore, the comparison finds nothing changed and short-circuits with upToDate: true — bypassing validateModulescheckCompatibility which would have detected the virtualStoreDir mismatch and triggered a purge + reinstall.

Fix

Add 'enableGlobalVirtualStore' to WORKSPACE_STATE_SETTING_KEYS in workspace/state/src/types.ts:

 export const WORKSPACE_STATE_SETTING_KEYS = [
+  'enableGlobalVirtualStore',
   'allowBuilds',
   'autoInstallPeers',

This ensures the workspace state detects the GVS toggle, checkDepsStatus returns upToDate: false, and the full mutateModules path runs (which includes the virtualStoreDir compatibility check and purge).


Written by an agent (opencode, glm-5.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions