Question
pnpm CLI ↔ pnpm Lockfile Schema: Is Rollback Safe After Schema Upgrade?
Sora Dey
0 reputation · 02 Aug 2020, 16:04 UTC
84.6K views0
Goal
Determine whether a pnpm installation can safely revert to an older CLI version after a lockfile schema upgrade without manual intervention.
Constraints & Uncertainty
- The CLI automatically bumps the lockfile to the newest schema (e.g., v6) when running
pnpm installwith a newer pnpm release. - Older pnpm binaries cannot parse newer lockfile versions, leading to install failures.
- No built‑in downgrade or rollback command exists to revert the lockfile format.
- Community discussions have proposed a
--lockfile-versionflag, but it is not yet stable. - CI pipelines may encounter inconsistent lockfile schemas if the lockfile is upgraded on one environment but not on another.
Open Questions
- Should pnpm embed a backward‑compatibility layer that allows older CLIs to understand newer lockfile schemas?
- Is enforcing strict lockfile regeneration on every pnpm upgrade a better strategy for ensuring consistency?
- What pragmatic workflow can teams adopt to safely roll back to an older pnpm CLI after a lockfile schema change?