Files
Zoltan Kochan 6ab3c27774 fix(config): honor the runtime setting (#17261)
pnpm v12 had Config::skip_runtimes but no source set it, so
`runtime: false` was dropped and only `--no-runtime` skipped the
runtimes from devEngines.runtime and engines.runtime. pnpm v11 passes
`skipRuntimes: opts.runtime === false` (installSingleProject.ts,
recursive/context.ts) and reads the setting from pnpm-workspace.yaml,
`pnpm_config_runtime`, and `--config.runtime`, not from the global
config.yaml, where `runtime` is an excluded key.

WorkspaceSettings now has a `runtime` field, read from
pnpm-workspace.yaml and PNPM_CONFIG_RUNTIME (and through it from
`--config.runtime`), cleared from the global config.yaml, and applied
as `skip_runtimes = !runtime`. `pnpm dedupe` and `pnpm prune` no longer
force runtimes on, as in v11, where both go through installDeps.
`pnpm dedupe` accepts `--no-runtime`, since v11 dedupe takes install's
options. v11 prune does not, so v12 prune stays without it.

updateConfig hooks see `runtime` as v11 shows it: absent until a source
sets it, and `false` under `--no-runtime`. The install pipelines record
`--no-runtime` as a CLI-set `runtime: false` before the hooks run, so a
hook cannot turn runtimes back on (v11 restoreCliSettings).

Intended difference from v11: with engineStrict, a skipped runtime
makes the root engine check use the active Node.js, which is v12's
existing `--no-runtime` behavior (pnpm/pnpm#15135). v11 checks against
the manifest runtime version even when it does not install it. dedupe
and prune now pass the configured runtime policy, like add, update, and
remove, and RuntimePolicy::Always is removed.

Tests: config-crate tests for the yaml, env override, and global
config.yaml exclusion; e2e tests in install_runtimes::no_runtime for
the yaml and `--config.runtime` skip, the CLI override, dedupe and
prune under the setting and `dedupe --no-runtime`, the hook view, a
hook unable to undo `--no-runtime`, and a hook setting `runtime: false`;
install_root_engine covers the engine check of dedupe and prune with a
skipped runtime. Each fix fails its test when reverted.

The install docs now spell the setting `runtime: false`, and the dedupe
docs list `--no-runtime`.
2026-10-23 11:10:27 +02:00
..
2026-10-22 23:45:10 +02:00