Skip to content

Regression: pnpm ci does not reinstall workspace node_modules in v11 #11427

@han-tyumi

Description

@han-tyumi

Last pnpm version that worked

10.33.2

pnpm version

11.0.3

Code to reproduce the issue

Minimal workspace:

mkdir pnpm-ci-test && cd pnpm-ci-test

cat > package.json <<'JSON'
{ "name": "test", "private": true, "type": "module" }
JSON

cat > pnpm-workspace.yaml <<'YAML'
packages:
  - packages/*
YAML

mkdir -p packages/foo
cat > packages/foo/package.json <<'JSON'
{
  "name": "foo",
  "version": "0.0.0",
  "private": true,
  "dependencies": { "left-pad": "1.3.0" }
}
JSON

# Generate a lockfile, then test ci.
npx -y pnpm@11.0.3 install
npx -y pnpm@11.0.3 ci
ls packages/foo/node_modules

Expected behavior

After pnpm ci, packages/foo/node_modules should contain the left-pad symlink (this is how it behaves in 10.33.2).

Actual behavior

packages/foo/node_modules is empty after pnpm ci. Only the root project's dependencies (if any) are installed; every workspace package is left without its node_modules repopulated.

Output of pnpm ci on the reproduction:

Removing node_modules
Removing packages/foo/node_modules
Lockfile is up to date, resolution step is skipped
Already up to date

Manually running pnpm clean && pnpm install --frozen-lockfile after the same starting state works correctly — workspace node_modules are repopulated. The regression appears specific to the combined pnpm ci flow.

Additional information

  • Verified the same break in a real monorepo (Astro + a shared TS package) before isolating the minimal repro above.
  • Side-by-side check using --reporter=ndjson shows both versions emit pnpm:scope with selected: 1 at the workspace root, so the difference isn't visible in that debug field — the install layer behaves differently after the implicit pnpm clean step in v11.
  • Different from pnpm ci leaves almost empty node_modules #11361 (which was about .pnpm-workspace-state-v1.json cleanup and is fixed in v11.0.0). That fix shipped, but this separate regression remains.

Node.js version

25.9.0

Operating System

macOS

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions