Skip to content

Commit cd1e385

Browse files
authored
Merge pull request #439 from Andarist/improve-missing-lockfile-entry-error
Improve the error thrown when the lockfile entry for the installed version can't be found
2 parents 0f93ced + 0e40506 commit cd1e385

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/getPackageResolution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function getPackageResolution({
4242
appLockFile = yaml.parse(lockFileString)
4343
} catch (e) {
4444
console.error(e)
45-
throw new Error("Could not parse yarn v2 lock file")
45+
throw new Error("Could not parse yarn v2 lock file")
4646
}
4747
}
4848

@@ -64,7 +64,7 @@ export function getPackageResolution({
6464

6565
if (resolutions.length === 0) {
6666
throw new Error(
67-
`Can't find lockfile entry for ${packageDetails.pathSpecifier}`,
67+
`\`${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.`,
6868
)
6969
}
7070

0 commit comments

Comments
 (0)