Skip to content

Commit

Permalink
fix(core): fix postinstall failure due to project graph build error
Browse files Browse the repository at this point in the history
Delegate error handling to calling functions and avoid `process.exit(1)`, which causes the package's postinstall stage to fail if there are problems with the project graph

Closes nrwl#9451
  • Loading branch information
tommazzo89 committed Apr 23, 2022
1 parent fa1bc7b commit 2d35a2c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/nx/src/project-graph/project-graph.ts
Expand Up @@ -54,13 +54,8 @@ export function readCachedProjectGraph(): ProjectGraph {
}

async function buildProjectGraphWithoutDaemon() {
try {
await defaultFileHasher.ensureInitialized();
return await buildProjectGraph();
} catch (e) {
printErrorMessage(e);
process.exit(1);
}
await defaultFileHasher.ensureInitialized();
return await buildProjectGraph();
}

/**
Expand Down

0 comments on commit 2d35a2c

Please sign in to comment.