ERR_PNPM_OUTDATED_LOCKFILE: Cannot install with frozen-lockfile because pnpm-lock.yaml is not up to date: how to fix it
ERR_PNPM_OUTDATED_LOCKFILE means pnpm was told to install exactly what pnpm-lock.yaml says (frozen-lockfile, the default in CI when a lockfile is present), and the lockfile no longer matches a package.json: a dependency was added or changed without re-running pnpm install, or the updated lockfile was never committed. Run pnpm install locally, commit pnpm-lock.yaml, and the install passes.
By Livops team, the people who build and run LivopsUpdated
The error, as pnpm 10 prints it[3][4] (shortened; the package names are examples):
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
Failure reason:
specifiers in the lockfile don't match specifiers in package.json:
* 1 dependencies were added: zod@^3.23.8
* 1 dependencies are mismatched:
- react (lockfile: ^18.3.1, manifest: ^19.0.0)
pnpm 9 printed the path without <ROOT>/[6]; it is the same error. This page explains what a frozen install checks, lists the ways pnpm-lock.yaml drifts from package.json, gives the fix for each, and covers the two related codes, ERR_PNPM_NO_LOCKFILE and ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. The npm version of the same problem has its own page: npm ci: package.json and package-lock.json not in sync.
What does the error mean?
With --frozen-lockfile, pnpm does not write a lockfile and fails if the lockfile is out of sync with the manifest, needs an update, or is missing[2]. You may never have typed the flag: in a CI environment it is true by default when a lockfile is present[2]. That is why the same commit installs on your machine and fails on the build server: locally, pnpm install updates the lockfile instead of stopping.
pnpm’s own description: the error happens when installation cannot be performed without changes to the lockfile, typically in CI after package.json was changed without running pnpm install, or when the lockfile changes were not committed[1].
Read the Failure reason. pnpm compares each package.json with its entry in the lockfile and says what differs[4]:
dependencies were added: <pkg>@<range>—package.jsonlists a package the lockfile does not have.dependencies were removed: <pkg>@<range>— the lockfile still has a packagepackage.jsonno longer lists.dependencies are mismatched: <pkg> (lockfile: <old>, manifest: <new>)— the range inpackage.jsonwas changed.
Read the path. <ROOT> is the folder that holds the lockfile, and the path after it names the package.json that disagrees[3]. <ROOT>/package.json is the root project; <ROOT>/packages/api/package.json is a workspace package.
Causes, most common first
1. package.json changed, the lockfile did not
You edited a version by hand, resolved a merge conflict in package.json only, or a bot bumped a range and left the lockfile behind. Fix — pnpm’s own: run pnpm install and commit the changes to the lockfile[1]:
pnpm install
git add package.json pnpm-lock.yaml
git commit -m "Update pnpm-lock.yaml"
2. The lockfile change was never committed
You did run pnpm install, but only package.json went into the commit. git status after the install shows pnpm-lock.yaml as modified; add it. If the file is missing from the repository altogether, a frozen install stops with a different code[3]:
ERR_PNPM_NO_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent
Take pnpm-lock.yaml out of .gitignore and commit it:
git add -f pnpm-lock.yaml
git commit -m "Commit pnpm-lock.yaml"
3. A workspace package was edited
In a workspace with a shared lockfile, pnpm keeps a single pnpm-lock.yaml at the root of the workspace[7], and it records every package in it. A dependency added to packages/api/package.json by hand is not in it, and the error names that file: <ROOT>/packages/api/package.json. Fix: run pnpm install at the root of the workspace, not inside the package, and commit the root lockfile together with the package’s package.json.
4. A different pnpm major version
The lockfile records its format at the top: pnpm 9 and 10 write lockfileVersion: '9.0'[5]. When the installing pnpm cannot use a lockfile’s format in a frozen install, it stops with a code of its own[1][3]:
ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE Cannot perform a frozen installation because the version of the lockfile is incompatible with this version of pnpm
pnpm’s hint lists three ways out: align the pnpm version that generated the lockfile with the one that installs from it, migrate the lockfile to the newer pnpm, or use pnpm install --no-frozen-lockfile[3]. The lasting fix is the first: pin one version for everybody (next section), then regenerate the lockfile with it and commit.
Compare pnpm -v on your machine with the version the build log prints.
5. Settings recorded in the lockfile changed
The lockfile also records some settings: overrides, patched dependencies, catalogs, ignored optional dependencies and a few resolution settings[1]. Change one of them and a frozen install stops with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH, which names the setting[1]; pnpm 10 prints it as[3]:
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile
Fix: run pnpm install without --frozen-lockfile and commit the updated lockfile[1].
Pin the pnpm version: packageManager and Corepack
Most “works for me” lockfile errors end when everybody installs with the same pnpm. Put the version in package.json:
{
"packageManager": "[email protected]"
}
Corepack reads this field and runs that package manager at that version; a hash after the version is optional but recommended[8]. Corepack is distributed with Node.js from 14.19.0 up to, but not including, 25.0.0[8]. On those versions run corepack enable; on Node 25 and later install it first with npm install -g corepack[8].
–no-frozen-lockfile: the last resort
pnpm install --no-frozen-lockfile allows lockfile updates during the install, and it is the way pnpm documents to allow them in CI[2]. It makes this error go away, and it is the wrong lasting fix:
- the server resolves the changed dependencies itself, so the build can get versions nobody tested;
- the lockfile it writes stays on the server, and the repository keeps the stale one, so the next build does the same.
Use it to unblock one build if you must. Then run pnpm install locally and commit pnpm-lock.yaml, and drop the flag.
How to confirm the fix locally
Run the same strict install the build runs, from a clean tree:
git status # pnpm-lock.yaml must not show as modified
rm -rf node_modules
pnpm install --frozen-lockfile
If it passes here with the same pnpm version, it passes on the server.
On Livops
What follows is how Livops builds a project today.
-
Which install runs. Livops picks the command from the lockfile you committed, in this order:
pnpm-lock.yaml,yarn.lock,bun.lock,package-lock.json. Withpnpm-lock.yamlthe log saysfound a pnpm lockfile — installing exactly those versionsand runspnpm install. The build runs withCI=true, so pnpm uses its frozen lockfile and this error can appear in the build log. -
A second attempt. If
pnpm installfails, the log sayspnpm install did not work — trying pnpm install --no-frozen-lockfile insteadand the install runs again without the strict check. The deploy can then pass, with the caveats of the section above: fix the lockfile anyway. -
The pnpm version. If
package.jsonpins one withpackageManager, the build runs that version. Install failed shows the field. -
Your own install command. Set Settings → Install, or
installinlivops.json, and that command runs as typed. To have a stale lockfile stop the deploy instead of being resolved on the server:{ "install": "pnpm install --frozen-lockfile" } -
When it still fails, the deploy stops as
install_failedand the old version keeps running. Next to the failed build, the assistant’s button reads the log and explains what happened. See Install failed. -
Node version. Livops builds with Node 22 and 24, and reads
.nvmrc,.node-versionanddevEnginesinpackage.json.
The Yarn version of this error is on its own page: YN0028: The lockfile would have been modified.
Questions
What does ERR_PNPM_OUTDATED_LOCKFILE mean?
pnpm was asked to install exactly what pnpm-lock.yaml records, without changing it, and the lockfile does not match a package.json in the project. The Failure reason lines under the message say which dependencies were added, removed or changed.
Why does it fail in CI but not on my laptop?
In a CI environment pnpm uses a frozen lockfile by default when one is present. On your laptop pnpm install quietly updates the lockfile instead. If that updated lockfile was never committed, CI still has the old one.
Is --no-frozen-lockfile a safe fix?
It makes the install pass, but pnpm then resolves the changed dependencies on the server, so the build can get versions you never tested, and the lockfile in the repository stays wrong. Use it to unblock one build, then run pnpm install locally and commit the lockfile.
What is ERR_PNPM_NO_LOCKFILE?
The same frozen install with no pnpm-lock.yaml at all: the message says the lockfile is absent. Commit pnpm-lock.yaml, and check that it is not listed in .gitignore.
What is ERR_PNPM_LOCKFILE_CONFIG_MISMATCH?
The lockfile records some settings, such as overrides, patched dependencies and catalogs. When the current configuration differs from what was recorded, a frozen install stops with this code. Run pnpm install without the frozen lockfile and commit the updated pnpm-lock.yaml.
Should I delete pnpm-lock.yaml and start over?
Only as a last resort. Without a lockfile every dependency can move to the newest version its range allows. Running pnpm install with the lockfile in place changes only what package.json now asks for.
How do I make CI use the same pnpm version as me?
Pin it in package.json with the packageManager field, for example [email protected]. Corepack then runs exactly that version wherever the project is installed.
Sources
- pnpm — Error codes (pnpm.io). Checked .
- pnpm — pnpm install (pnpm.io). Checked .
- pnpm 10.34.9 source — pkg-manager/core/src/install/index.ts (raw.githubusercontent.com). Checked .
- pnpm 10.34.9 source — lockfile/verification/src/satisfiesPackageManifest.ts (raw.githubusercontent.com). Checked .
- pnpm 10.34.9 source — packages/constants/src/index.ts (raw.githubusercontent.com). Checked .
- pnpm 9.0.0 source — pkg-manager/core/src/install/index.ts (raw.githubusercontent.com). Checked .
- pnpm — Workspaces (pnpm.io). Checked .
- Corepack — README (github.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Node appRelated
- YN0028: The lockfile would have been modified by this install, which is explicitly forbidden: how to fix itYN0028 (FROZEN_LOCKFILE_EXCEPTION) means Yarn was running an immutable install, the default on CI, and finishing it would have changed yarn.lock: a dependency was added or changed without re-running yarn install, the updated yarn.lock was not committed, or another Yarn release needs to migrate the lockfile. Run yarn install locally with the project's Yarn version and commit yarn.lock. Yarn 1 says the same with: Your lockfile needs to be updated, but yarn was run with --frozen-lockfile.
- npm ci can only install packages when your package.json and package-lock.json are in sync: how to fix itnpm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync (npm error code EUSAGE) means the committed lockfile no longer matches package.json: a dependency was added or changed without re-running npm install, or the lockfile was not committed. Run npm install locally, commit package.json and package-lock.json together, and npm ci passes.
- npm ERR! code ERESOLVE unable to resolve dependency tree: how to fix itnpm ERR! code ERESOLVE, unable to resolve dependency tree (npm error ERESOLVE in newer npm) means two packages in your project need versions of a shared peer dependency that cannot both be met. Since npm 7 installs peer dependencies, it stops instead of guessing. The real fix is to make the versions match: upgrade the package that is behind, or use the version it supports. --legacy-peer-deps and --force only skip the check.
- npm failed with return code 1 (npm ERR! code 1): how to fix the buildnpm failed with return code 1, or npm install exited with 1, is npm ERR! code 1 in newer npm: it only says that a script npm ran exited with code 1. The real error is printed above it: usually a compile or type error, a lockfile out of sync with package.json, or a dependency whose install script failed. Find the first error line above code 1, fix that, and the build passes.
- Error: Cannot find module (MODULE_NOT_FOUND) in Node.js: how to fix itError: Cannot find module 'x' with code MODULE_NOT_FOUND, or ERR_MODULE_NOT_FOUND with import, means Node.js looked for a package or file and it was not there. On a server the usual causes are a package missing from package.json, a devDependency the install skipped, a path whose case differs from the file, a start command pointing at a file that was never built, or an ES module import without its .js extension.
- Node.js hosting in 2026: how to deploy an Express appA Node.js server in production needs one long-running process that listens on the port it is given, restarts when it crashes and exits cleanly on SIGTERM. On Livops you push a repository with package.json and it runs as a web app for 39 credits a month (39,000 so'm). Here is what Node needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- Next.js hosting without Vercel: the options comparedNext.js runs on any host that runs Node: next build, then next start, and every feature works, Server Actions and image optimization included. On Livops a repository with next in package.json runs as a server from a push for 39 credits a month (39,000 so'm), and a static export is free. Here is how Vercel, Render, Railway, Fly.io and a VPS compare.