Skip to content
Latchkey

pnpm "ERR_PNPM_LOCKFILE_CONFIG_MISMATCH" in CI

pnpm records the install settings that influence resolution (like hoist patterns or the node-linker) in the lockfile. When those settings differ from the current config under a frozen install, pnpm refuses to continue.

What this error means

pnpm install fails with "ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current configuration doesn't match the value found in the lockfile".

pnpm
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "settings.autoInstallPeers" configuration doesn't match the value found in the lockfile

Expected: true
Actual: false

Common causes

A lockfile-affecting setting changed without relocking

A setting such as auto-install-peers, node-linker, or hoist patterns was edited in .npmrc or package.json but the lockfile still records the old value.

CI and local use different pnpm configuration

An environment variable or a different .npmrc in CI sets a value the committed lockfile was not generated with.

How to fix it

Regenerate the lockfile with the new settings

  1. Set the intended settings in .npmrc or package.json.
  2. Run pnpm install locally to rewrite the lockfile with those values.
  3. Commit the updated pnpm-lock.yaml.
Terminal
pnpm install
git add pnpm-lock.yaml .npmrc

Make CI config match the lockfile

Ensure the same .npmrc and pnpm settings are present in CI as when the lockfile was generated, so no setting diverges.

.npmrc
auto-install-peers=true
node-linker=isolated

How to prevent it

  • Commit .npmrc so lockfile-affecting settings are consistent everywhere.
  • Relock after changing node-linker, hoist patterns, or peer settings.
  • Avoid setting pnpm config via ad hoc env vars only in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →