mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-13 02:55:56 -04:00
* fix(self-update): do not downgrade when latest dist-tag is older `pnpm self-update` defaults to the `latest` dist-tag, but `latest` on the registry can lag the installed version when a new major has shipped without being tagged. Refuse to downgrade in that case. Users can still run `pnpm self-update latest` (explicit) to force the downgrade. Closes #11418 * fix(self-update): use lockfile-pinned version for project-pin downgrade check When a project pins pnpm via a range (e.g. `devEngines.packageManager.version: ">=8.0.0"`) and the env lockfile pins an exact version above the range's lower bound, the previous guard compared the resolved `latest` against `semver.minVersion(spec)` and missed the downgrade. Read `packageManagerDependencies.pnpm.version` from `pnpm-lock.yaml` and use the max of (lockfile-pinned, spec.minVersion) as the current version. Also fix the explicit-`latest` test which mocked `latest` as newer than the current version, defeating its own assertion. * chore(engine.pm.commands): add lockfile/fs project reference to tsconfig