mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-25 08:08:14 -05:00
fix(patch): error message for missing .modules.yaml (#8315)
close #8257
This commit is contained in:
6
.changeset/lemon-forks-leave.md
Normal file
6
.changeset/lemon-forks-leave.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-patching": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Correct the error message when trying to run `pnpm patch` without `node_modules/.modules.yaml` [#8257](https://github.com/pnpm/pnpm/issues/8257).
|
||||
@@ -4,7 +4,6 @@ import { prompt } from 'enquirer'
|
||||
import { readCurrentLockfile, type TarballResolution } from '@pnpm/lockfile-file'
|
||||
import { nameVerFromPkgSnapshot } from '@pnpm/lockfile-utils'
|
||||
import { PnpmError } from '@pnpm/error'
|
||||
import { WANTED_LOCKFILE } from '@pnpm/constants'
|
||||
import { readModulesManifest } from '@pnpm/modules-yaml'
|
||||
import { isGitHostedPkgUrl } from '@pnpm/pick-fetcher'
|
||||
import realpathMissing from 'realpath-missing'
|
||||
@@ -76,7 +75,10 @@ export async function getVersionsFromLockfile (dep: ParseWantedDependencyResult,
|
||||
if (!lockfile) {
|
||||
throw new PnpmError(
|
||||
'PATCH_NO_LOCKFILE',
|
||||
`No ${WANTED_LOCKFILE} found: Cannot patch without a lockfile`
|
||||
'The modules directory is not ready for patching',
|
||||
{
|
||||
hint: 'Run pnpm install first',
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user