# 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.

Source: https://livops.dev/en/guides/error-pnpm-outdated-lockfile

By Livops team, the people who build and run Livops. Updated 3 December 2026.

The error, as pnpm 10 prints it[3][4] (shortened; the package names are examples):

```text
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](https://livops.dev/en/guides/error-npm-ci-lockfile-out-of-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.json` lists a package the lockfile does not have.
- `dependencies were removed: <pkg>@<range>` — the lockfile still has a package `package.json` no longer lists.
- `dependencies are mismatched: <pkg> (lockfile: <old>, manifest: <new>)` — the range in `package.json` was 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]:

```sh
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]:

```text
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:

```sh
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]:

```text
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]:

```text
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`:

```json
{
  "packageManager": "pnpm@10.34.9"
}
```

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:

```sh
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`. With `pnpm-lock.yaml` the log says `found a pnpm lockfile — installing exactly those versions` and runs `pnpm install`. The build runs with `CI=true`, so pnpm uses its frozen lockfile and this error can appear in the build log.
- **A second attempt.** If `pnpm install` fails, the log says `pnpm install did not work — trying pnpm install --no-frozen-lockfile instead` and 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.json` pins one with `packageManager`, the build runs that version. [Install failed](https://livops.dev/en/docs/error-install#dev-engines) shows the field.
- **Your own install command.** Set **Settings → Install**, or `install` in `livops.json`, and that command runs as typed. To have a stale lockfile stop the deploy instead of being resolved on the server:

  ```json
  {
    "install": "pnpm install --frozen-lockfile"
  }
  ```

- **When it still fails**, the deploy stops as `install_failed` and the old version keeps running. Next to the failed build, the assistant's button reads the log and explains what happened. See [Install failed](https://livops.dev/en/docs/error-install).
- **Node version.** Livops builds with Node 22 and 24, and reads `.nvmrc`, `.node-version` and `devEngines` in `package.json`.

The Yarn version of this error is on its own page: [YN0028: The lockfile would have been modified](https://livops.dev/en/guides/error-yarn-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 pnpm@10.34.9. Corepack then runs exactly that version wherever the project is installed.

## Sources

1. [pnpm — Error codes](https://pnpm.io/errors). Checked 3 December 2026.
2. [pnpm — pnpm install](https://pnpm.io/cli/install). Checked 3 December 2026.
3. [pnpm 10.34.9 source — pkg-manager/core/src/install/index.ts](https://raw.githubusercontent.com/pnpm/pnpm/v10.34.9/pkg-manager/core/src/install/index.ts). Checked 3 December 2026.
4. [pnpm 10.34.9 source — lockfile/verification/src/satisfiesPackageManifest.ts](https://raw.githubusercontent.com/pnpm/pnpm/v10.34.9/lockfile/verification/src/satisfiesPackageManifest.ts). Checked 3 December 2026.
5. [pnpm 10.34.9 source — packages/constants/src/index.ts](https://raw.githubusercontent.com/pnpm/pnpm/v10.34.9/packages/constants/src/index.ts). Checked 3 December 2026.
6. [pnpm 9.0.0 source — pkg-manager/core/src/install/index.ts](https://raw.githubusercontent.com/pnpm/pnpm/v9.0.0/pkg-manager/core/src/install/index.ts). Checked 3 December 2026.
7. [pnpm — Workspaces](https://pnpm.io/workspaces). Checked 3 December 2026.
8. [Corepack — README](https://github.com/nodejs/corepack). Checked 3 December 2026.
