fix: better no lockfile error

This commit is contained in:
Zoltan Kochan
2022-10-18 02:18:55 +03:00
parent e7970724d7
commit 768d41745f
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/outdated": patch
"pnpm": patch
---
When the `pnpm outdated` command fails, print in which directory it failed.

View File

@@ -49,7 +49,7 @@ export async function outdated (
): Promise<OutdatedPackage[]> {
if (packageHasNoDeps(opts.manifest)) return []
if (opts.wantedLockfile == null) {
throw new PnpmError('OUTDATED_NO_LOCKFILE', 'No lockfile in this directory. Run `pnpm install` to generate one.')
throw new PnpmError('OUTDATED_NO_LOCKFILE', `No lockfile in directory "${opts.lockfileDir}". Run \`pnpm install\` to generate one.`)
}
const allDeps = getAllDependenciesFromManifest(opts.manifest)
const importerId = getLockfileImporterId(opts.lockfileDir, opts.prefix)