mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 12:01:37 -04:00
fix: make the FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE error and hint messages more clear (#6304)
Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
committed by
GitHub
parent
9fd0e375e9
commit
e87754df1f
6
.changeset/tender-ties-punch.md
Normal file
6
.changeset/tender-ties-punch.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/core": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Improve the outdated lockfile error message [#6304](https://github.com/pnpm/pnpm/pull/6304).
|
||||
@@ -351,9 +351,16 @@ export async function mutateModules (
|
||||
)
|
||||
) {
|
||||
if (needsFullResolution) {
|
||||
throw new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE', 'Cannot perform a frozen installation because the lockfile needs updates', {
|
||||
hint: '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"',
|
||||
})
|
||||
throw new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE',
|
||||
'Cannot perform a frozen installation because the version of the lockfile is incompatible with this version of pnpm',
|
||||
{
|
||||
hint: `Try either:
|
||||
1. Aligning the version of pnpm that generated the lockfile with the version that installs from it, or
|
||||
2. Migrating the lockfile so that it is compatible with the newer version of pnpm, or
|
||||
3. Using "pnpm install --no-frozen-lockfile".
|
||||
Note that in CI environments, this setting is enabled by default.`,
|
||||
}
|
||||
)
|
||||
}
|
||||
if (opts.lockfileOnly) {
|
||||
// The lockfile will only be changed if the workspace will have new projects with no dependencies.
|
||||
|
||||
@@ -95,7 +95,7 @@ test('versions are replaced with versions specified through overrides option', a
|
||||
}, await testDefaults({ frozenLockfile: true, overrides }))
|
||||
).rejects.toThrow(
|
||||
new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE',
|
||||
'Cannot perform a frozen installation because the lockfile needs updates'
|
||||
'Cannot perform a frozen installation because the version of the lockfile is incompatible with this version of pnpm'
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
@@ -89,7 +89,7 @@ test('manifests are extended with fields specified by packageExtensions', async
|
||||
}, await testDefaults({ frozenLockfile: true, packageExtensions }))
|
||||
).rejects.toThrow(
|
||||
new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE',
|
||||
'Cannot perform a frozen installation because the lockfile needs updates'
|
||||
'Cannot perform a frozen installation because the version of the lockfile is incompatible with this version of pnpm'
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user