Files
pnpm/pnpm11/installing/modules-yaml/test
Zoltan Kochan 5df4a8295a fix(package-manager): stop purging node_modules on an unreadable .modules.yaml (#14073)
A `.modules.yaml` the reader could not parse was treated as layout drift,
so every install deleted the whole `node_modules` directory — the user's
own entries included — and relinked the tree from scratch, emitting one
`pnpm:_broken_node_modules` event per package with nothing on stderr to
explain it. That is how a manifest key longer than YAML's simple-key
limit (fixed in pnpm/pnpm#13885) surfaced as an endless re-link in
pnpm/pnpm#14062.

Fail the install on an unreadable state file instead, matching the
TypeScript CLI's `readModulesManifest`, which rethrows everything but
`ENOENT`.

An unsupported `layoutVersion` no longer travels as a parse error: it now
reads as "no layout version", the same signal a missing field carries, so
a `node_modules` from an older layout still rebuilds rather than failing
the install. pnpm reads any number there too and leaves the decision to
its own compatibility check.

Also adds `chcp` to the spell-check dictionary: the changeset for
pnpm/pnpm#13998 names that Windows command and fails the pre-push hook.
2026-08-22 17:03:54 +02:00
..