Skip to content
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

Improve the error thrown when the lockfile entry for the installed version can't be found #439

Merged
merged 2 commits into from
Dec 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/getPackageResolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function getPackageResolution({
appLockFile = yaml.parse(lockFileString)
} catch (e) {
console.error(e)
throw new Error("Could not parse yarn v2 lock file")
throw new Error("Could not parse yarn v2 lock file")
}
}

Expand All @@ -64,7 +64,7 @@ export function getPackageResolution({

if (resolutions.length === 0) {
throw new Error(
`Can't find lockfile entry for ${packageDetails.pathSpecifier}`,
`\`${packageDetails.pathSpecifier}\`'s installed version is ${installedVersion} but a lockfile entry for it couldn't be found. Your lockfile is likely to be corrupt or you forgot to reinstall your packages.`,
)
}

Expand Down