action-setup
action-setup copied to clipboard
Error in CI: ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE Cannot perform a frozen installation because the lockfile needs updates
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 `
npm i --fix-lockfile
Can you try pnpm i --fix-lockfile?
@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.
For now i have fixed issue by adding following to my .npmrc file
auto-install-peers=true
strict-peer-dependencies=false
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.
Is you using latest pnpm the version of 7.x?
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.
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
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]
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"
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"
},
You need to update pnpm before running it :)
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.
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.
Same here. Upgraded from pnpm v7 to v8 and fixing the lock file using the --fix-lockfile option fixed the issue
same problem today. this worked for us.
corepack prepare pnpm@latest --activatecorepack enablepnpm -vshould see 8.0.0pnpm 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...
@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.
I guess the takeaway from this issue is to always use specific versions of external dependencies in CI.
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)
pnpm lock is incompatible between v7 and v8? any plan to fix?
@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.
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 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
pnpmversion. 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@^7and stick with the old lockfile.
thanks!
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.