This repository reproduces a pnpm 11.1.1 issue where pnpm install exits with Already up to date and leaves pnpm-lock.yaml conflicted.
The issue appears when:
optimistic-repeat-install=truenode_modulesalready matches the current branch- a merge introduces a
pnpm-lock.yamlconflict - the other branch only changes a patch file and the lockfile entries generated from that patch
git clone https://github.com/Stanzilla/pnpm-optimistic-patch-lockfile-repro.git
cd pnpm-optimistic-patch-lockfile-repro
pnpm install
git merge origin/update-patch
pnpm install
grep -n '<<<<<<<' pnpm-lock.yamlExpected: pnpm install detects and resolves the lockfile conflict, updating the lockfile to include both the is-odd dependency from main and the updated is-number patch hash from update-patch.
Actual with pnpm 11.1.1: pnpm install prints Already up to date, exits successfully, and leaves conflict markers in pnpm-lock.yaml.
As a control, removing node_modules before the final install makes pnpm resolve the conflict:
rm -rf node_modules
pnpm install
grep -n '<<<<<<<' pnpm-lock.yaml || echo 'conflict resolved'