pnpm: Frozen lockfile error despite up to date lockfile

pnpm version: 8.0.0 (though 7.30 seems also affected)

Running pnpm install --frozen-lockfile yields:

Lockfile is up to date, resolution step is skipped
 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json

Now when I run pnpm install, there are no lockfile changes.

Interestingly enough this also happens:

❯ pnpm cache
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command failed with ENOENT: cache
spawn cache ENOENT

I don’t have a repro, because I’m somewhat sure that this is my system being bonked, but I also could not find any guides for doing a clean uninstall (I tried store pruning, resetted all the configs etc)

Additional information:

  • node -v prints: v18.13.0
  • Windows, macOS, or Linux?: macOS Ventura 13.0

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 14
  • Comments: 29 (5 by maintainers)

Commits related to this issue

Most upvoted comments

How did y’all upgrade the lockfile version? I’m running 8.15.2 and it is still generates a lockfile version 6. We are using pnpm on the latest MacOS

Just manually change the version number

Just upgraded lockfileVersion in pnpm.lock.yaml from 6.0 to 8.5.1 and boom, deployed successfully

image

I’m seeing this with version 9 of the lock file ( pnpm v10.4.1):

lockfileVersion: '9.0'

settings:
  autoInstallPeers: false
  excludeLinksFromLockfile: false

Interestingly the error is

Scope: all 74 workspace projects
 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/services/user-data-service/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 specs in package.json ({"@XXXX/_cicd":"*"})

We’re removed all mention of _cicd from the monorepo and don’t understand where this comes from. I’ve run pnpm -r update and pushed those changes, and it still says the lock file is out of date.

Try downgrading PNPM to v7 or upgrade the lockfile to v8

I’m seeing this error only on CI.

My problem is not why lock file is not latest. My problem is why pnpm output:

Lockfile is up to date, resolution step is skipped

@zkochan

make sure the lockfileVersion is the same as the one you have on the github actions you’ve set up on the .yaml file. lock.yaml -> lockfileVersion: 9.0 <=> CI.yaml -> add - name: Install pnpm uses: pnpm/action-setup@v2 with: version: 9.0

I’m seeing this with version 9 of the lock file ( pnpm v10.4.1):

lockfileVersion: '9.0'

settings:
  autoInstallPeers: false
  excludeLinksFromLockfile: false

Interestingly the error is

Scope: all 74 workspace projects
 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with <ROOT>/services/user-data-service/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 specs in package.json ({"@XXXX/_cicd":"*"})

We’re removed all mention of _cicd from the monorepo and don’t understand where this comes from. I’ve run pnpm -r update and pushed those changes, and it still says the lock file is out of date.

Same here. Removed all references to a package in my monorepo but and get the same error still. How did you fix it?

Updating to pnpm@8.5.1 and re-installing deps resolved this for me.

can confirm upgrading to 8 on a mac causes this issue when it is run in linux

pnpm config set auto-install-peers false used this command on the mac to fix the issue

I understand what is your problem but I can’t fix it if I can’t reproduce it. You should provide steps to reproduce. If not, with more info in the error message maybe we’ll be able to figure out the issue.