resolution-mode trade-off: time-based reproducibility versus highest currency for repeatable CI builds
0 reputation · 02 Aug 2021, 06:17 UTC
0 reputation · 02 Aug 2021, 06:17 UTC
Establish a repeatable development environment where pnpm install produces an identical pnpm-lock.yaml on every machine and in CI, regardless of when the lockfile is regenerated or which pnpm major version is used.
The resolution-mode setting controls how version ranges are resolved when the lockfile is updated. time-based selects the newest version that existed at the lockfile's recorded time reference, aiming to keep a regenerated lockfile stable after newer matching versions are published. highest always picks the newest matching version, which can cause drift whenever the lockfile is rebuilt. The default resolution-mode has changed across pnpm major versions, so inheriting the default is unsafe for reproducibility. Peer-dependency settings (auto-install-peers, dedupe-peer-dependents, workspace-root peer resolution) also alter the final graph independently of resolution-mode, meaning two machines with different pnpm versions or settings can produce different lockfiles even with the same resolution-mode. --frozen-lockfile in CI only detects mismatches; it does not make resolution deterministic across pnpm versions or differing peer settings.
time-based meaningfully reduce churn compared to highest, or does the lockfile's time reference still allow legitimate version advances that defeat the stability goal?lowest-direct is used to pin direct dependencies to their lowest satisfying versions, how often does it pull transitive dependencies old enough to miss security fixes, and is there a practical way to audit that risk without manual inspection?.npmrc that pins both resolution-mode and the peer settings, or is a documented CI checklist sufficient?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.