Skip to content

Commit

Permalink
fix(js): do not write cached lockfile parsed results when an error is…
Browse files Browse the repository at this point in the history
… thrown
  • Loading branch information
FrozenPandaz committed Mar 27, 2024
1 parent fa5c99f commit e72c4b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/nx/src/plugins/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export const createDependencies: CreateDependencies = (
lockFileExists(packageManager) &&
parsedLockFile
) {
if (!parsedLockFile.externalNodes) {
throw new Error(
'Could not create dependencies because there was an error creating nodes'
);
}

const lockFilePath = join(workspaceRoot, getLockFileName(packageManager));
const lockFileContents = readFileSync(lockFilePath).toString();
const lockFileHash = getLockFileHash(lockFileContents);
Expand Down

0 comments on commit e72c4b9

Please sign in to comment.