Skip to content

Commit

Permalink
Merge pull request #439 from Andarist/improve-missing-lockfile-entry-…
Browse files Browse the repository at this point in the history
…error

Improve the error thrown when the lockfile entry for the installed version can't be found
  • Loading branch information
orta committed Dec 28, 2022
2 parents 0f93ced + 0e40506 commit cd1e385
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit cd1e385

Please sign in to comment.