Skip to content

[finding] The scaffolded pnpm-workspace.yaml has no packages: key, so pnpm 10.0.0 refuses the install outright — "ERROR packages field missing or empty" #10497

Description

@os-elon

Found while measuring #10405 (the missing allowBuilds key). Different pnpm band, different failure, so filed rather than ridden.

What happens

Both scaffold paths write a pnpm-workspace.yaml that deliberately omits packages:renderPnpmWorkspaceYaml() in packages/cli/src/commands/init.ts says so in a comment ("Kept minimal (no packages: key) so it acts purely as a settings file"), and packages/create-objectstack/src/templates/blank/pnpm-workspace.yaml has no packages: key either.

Early pnpm 10 rejects that file. Measured on a two-dependency probe project carrying exactly the rendered shape, one clean install per pnpm version, each with its own store:

$ pnpm install # pnpm 10.0.0
ERROR packages field missing or empty
For help, run: pnpm help install
install EXIT=1

The failure is independent of the build-approval keys: pnpm 10.0.0 exits 1 with onlyBuiltDependencies present, with allowBuilds present, and with both. pnpm 10.15.0 and everything above it accept the keyless file, so the affected band is narrow and old (somewhere in 10.0.x through <=10.14.x — the exact ceiling was not bisected, only that 10.0.0 fails and 10.15.0 does not).

Why it is a finding and not a fix

Adding packages: is not a mechanical change with a settled shape. Nothing in the repo pins what a single-package scaffold should declare there, both scaffold paths deliberately omit it today, and packages: [] versus packages: ['.'] are different statements about whether the scaffolded project is a workspace root. That is a decision, not a typo.

Severity is genuinely low — pnpm 10.0.0 shipped in January 2025 and the band closes by 10.15 — so this may well be closed as won't-fix. Filing it because it was measured, and because "the scaffold cannot install" is the same failure sentence as #10405 even though the cause is unrelated.

Repro

mkdir probe && cd probe
printf '{"name":"probe","version":"0.0.0","private":true,"dependencies":{"esbuild":"0.28.2"}}\n' > package.json
printf 'onlyBuiltDependencies:\n - esbuild\n' > pnpm-workspace.yaml
npx pnpm@10.0.0 install --store-dir ./.store # EXIT=1, packages field missing or empty
npx pnpm@10.15.0 install --store-dir ./.store2 # EXIT=0

Filed unassigned, not graded or routed.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions