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".
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: falseCommon 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
- Set the intended settings in
.npmrcorpackage.json. - Run
pnpm installlocally to rewrite the lockfile with those values. - Commit the updated
pnpm-lock.yaml.
pnpm install
git add pnpm-lock.yaml .npmrcMake 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.
auto-install-peers=true
node-linker=isolatedHow to prevent it
- Commit
.npmrcso 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.