Skip to content

Error in CI: ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE  Cannot perform a frozen installation because the lockfile needs updates #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pinalbhatt opened this issue May 1, 2022 · 24 comments
Assignees

Comments

@pinalbhatt
Copy link

pinalbhatt commented May 1, 2022

My Action Step is
`

  uses: pnpm/[email protected]

  with:

    version: 6.x

    run_install: true

`

I am getting below error when running this action

Error in CI: ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE  Cannot perform a frozen installation because the lockfile needs updates

and when try to fix my lockfile locally with command npm i --fix-lockfile i get following error:
`
npm i --fix-lockfile
npm ERR! Cannot read properties of null (reading 'matches')

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/un/.npm/_logs/2022-05-01T10_32_11_056Z-debug-0.log
`

@KSXGitHub
Copy link
Collaborator

npm i --fix-lockfile

Can you try pnpm i --fix-lockfile?

@pinalbhatt
Copy link
Author

@KSXGitHub

pnpm i --fix-lockfile
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  [email protected][email protected][email protected] isn't supported by any available resolver.

This error happened while installing the dependencies of [email protected]
Progress: resolved 28, reused 29, downloaded 0, added 0

Note that npm i --legacy-peer-deps works fine when using npm.

@pinalbhatt
Copy link
Author

For now i have fixed issue by adding following to my .npmrc file

auto-install-peers=true

strict-peer-dependencies=false

@zkochan
Copy link
Member

zkochan commented May 1, 2022

and when try to fix my lockfile locally with command npm i --fix-lockfile i get following error:

Why do you run npm i if you use pnpm?

You should run pnpm install and commit the lockfile.

@Innei
Copy link

Innei commented May 2, 2022

Is you using latest pnpm the version of 7.x?

@liuzhaowei55
Copy link

the same error

➜  toolbox git:(master) pnpm i --fix-lockfile
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  [email protected][email protected] isn't supported by any available resolver.

@liuzhaowei55
Copy link

the same error

➜  toolbox git:(master) pnpm i --fix-lockfile
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  [email protected][email protected] isn't supported by any available resolver.

rerun pnpm install and commit the lockfile, its ok

@damiangreen
Copy link

the same error with node-fetch

I have this in my resolutions

"node-fetch": "@2.6.7",
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  node-fetch@@2.6.7 isn't supported by any available resolver.

This error happened while installing the dependencies of [email protected]

@bartvanremortele
Copy link

Same error here.

➜  pnpm i --fix-lockfile
Scope: all 10 workspace projects
.../apps/app:
 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  [email protected][email protected] isn't supported by any available resolver.

This error happened while installing the dependencies of @hookform/[email protected]
Progress: resolved 309, reused 309, downloaded 0, added 0

getting this in CI:

Scope: all 10 workspace projects
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 apps/app/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"

@PaulRBerg
Copy link

Same error! Running pnpm i --fix-lockfile does not change the lockfile, but in CI I keep getting an error.

This is with a project that has a peer dependency listed like this:

"peerDependencies": {
  "@ethersproject/bignumber": "5.x"
},

@ramnes
Copy link

ramnes commented Mar 28, 2023

You need to update pnpm before running it :)

@PaulRBerg
Copy link

PaulRBerg commented Mar 28, 2023

Yeah, I was on v7.30.1. After upgrading to v8, I can confirm that running --fix-lockfile fixed the issue.

Thanks for your help, @ramnes.

@jonraem
Copy link

jonraem commented Mar 28, 2023

Just encountered the same issue in Azure Pipelines. I can also confirm that updating from pnpm 7 to 8 and fixing the lockfile again worked for me.

@talik077
Copy link

Same here. Upgraded from pnpm v7 to v8 and fixing the lock file using the --fix-lockfile option fixed the issue

@jyono
Copy link

jyono commented Mar 28, 2023

same problem today. this worked for us.

  • corepack prepare pnpm@latest --activate
  • corepack enable
  • pnpm -v should see 8.0.0
  • pnpm i --fix-lockfile

not sure exactly what caused this but maybe something upstream? it feels suspicious that this issue had comments September 2022 and now there's a lot more traffic today...

@echocrow
Copy link

echocrow commented Mar 28, 2023

@jyono The spike is probably related to the pnpm v8 release just a few hours ago, which seems to require a new lockfile version when installing with --frozen-lockfile (which some CI/CD environments default to).

We ran into this issue too, because our CI/CD was pulling the latest pnpm version. Earlier today, that was v7, until this switched to v8, breaking our builds due to the unsupported lockfile version.

Locally installing pnpm v8 and updating the lockfile (as per above posts) worked.

Alternatively, you can also fix your pnpm version to pnpm@^7 and stick with the old lockfile.

@PaulRBerg
Copy link

PaulRBerg commented Mar 28, 2023

I guess the takeaway from this issue is to always use specific versions of external dependencies in CI.

@echocrow
Copy link

I guess the takeaway from this issue is to always use specific versions of external dependencies in CI.

(+1, ironically also why the lockfiles in question exist)

@njleonzhang
Copy link

pnpm lock is incompatible between v7 and v8? any plan to fix?

@echocrow
Copy link

@njleonzhang probably better to open a separate issue or discussion on this. but from my understanding, pnpm v8 can read lockfile v5 (used by pnpm v7) , and will automatically upgrade them to lockfile v6 when running pnpm install. (This is also stated in their v8 migration instructions.)

the recent comments in this issue arose from running pnpm install --frozen-lockfile (which prohibits updates to the lockfile) with pnpm v8 while still using a lockfile v5.

shamoon referenced this issue in gethomepage/homepage Mar 29, 2023
@exsesx
Copy link

exsesx commented Mar 30, 2023

I have a @formkit/auto-animate dependency, version 1.0.0-beta.6, pnpm version 8.1.0

I'm getting the ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  @formkit@[email protected] isn't supported by any available resolver. error in CI.

@jyono
Copy link

jyono commented Mar 30, 2023

@jyono The spike is probably related to the pnpm v8 release just a few hours ago, which seems to require a new lockfile version when installing with --frozen-lockfile (which some CI/CD environments default to).

We ran into this issue too, because our CI/CD was pulling the latest pnpm version. Earlier today, that was v7, until this switched to v8, breaking our builds due to the unsupported lockfile version.

Locally installing pnpm v8 and updating the lockfile (as per above posts) worked.

Alternatively, you can also fix your pnpm version to pnpm@^7 and stick with the old lockfile.

thanks!

@so1ve
Copy link

so1ve commented Apr 1, 2023

Summary:
Use corepack to manage package manager is the best choice. This enforces the same manager in different environments. For example, you are running pnpm@7 locally but pnpm@8 in ci, the lockfile format will break the installation. So, please make sure you have packageManager field defined in your package.json instead of specifing a pnpm version in the workflow file manually.

atahrijouti added a commit to atahrijouti/atahrijouti.github.io that referenced this issue Apr 8, 2023
atahrijouti added a commit to atahrijouti/atahrijouti.github.io that referenced this issue Apr 8, 2023
* pin all deps explicitly and update them

* do it the right way 🤷‍♂️

* fix lockfile

* pnpm update

* λ pnpm install --fix-lockfile

* upgrade pnpm to v8

pnpm/action-setup#40 (comment)
@alex-page
Copy link

alex-page commented Aug 8, 2024

If you encounter this error with pnpm catalog you might have an incorrectly added " or , in the pnpm-workspace.yaml file. The error message makes this hard to quickly understand as it will say something like:

 ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER  del-cli@^5.1.0, isn't supported by any available resolver.

 Removing the , from your pnpm-workspace.yaml will help resolve the issue:

  del-cli: ^5.1.0,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests