From 2647e489238e24c420d327590d88b90486efc55c Mon Sep 17 00:00:00 2001 From: Thomas Pusztai <11061338+tommazzo89@users.noreply.github.com> Date: Tue, 26 Apr 2022 01:39:43 +0200 Subject: [PATCH] fix(core): fix postinstall failure due to project graph build error (#9960) 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 #9451 --- packages/nx/src/project-graph/project-graph.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/nx/src/project-graph/project-graph.ts b/packages/nx/src/project-graph/project-graph.ts index 8b30795bc9f20..e1a1b3f023258 100644 --- a/packages/nx/src/project-graph/project-graph.ts +++ b/packages/nx/src/project-graph/project-graph.ts @@ -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(); } /**