From e44199142d6d0fc682e92b9b8e525611d063c78f Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Thu, 6 Jun 2024 15:52:56 -0400 Subject: [PATCH] fix(core): fix postinstall when nx is not resolveable (#26433) ## Current Behavior `postinstall` task exits 1 when errors are thrown. ## Expected Behavior `postinstall` task always exits 0. Errors are OK because nothing here is critical. ## Related Issue(s) Fixes https://github.com/nrwl/nx/issues/26400 --- packages/nx/bin/post-install.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/nx/bin/post-install.ts b/packages/nx/bin/post-install.ts index 6e2fe71d48..e7d22743e5 100644 --- a/packages/nx/bin/post-install.ts +++ b/packages/nx/bin/post-install.ts @@ -13,7 +13,6 @@ import { logger } from '../src/utils/logger'; (async () => { const start = new Date(); - let errored = false; try { setupWorkspaceContext(workspaceRoot); if (isMainNxPackage() && fileExists(join(workspaceRoot, 'nx.json'))) { @@ -39,7 +38,6 @@ import { logger } from '../src/utils/logger'; ); } } catch (e) { - errored = true; logger.verbose(e); } finally { const end = new Date(); @@ -47,7 +45,7 @@ import { logger } from '../src/utils/logger'; `Nx postinstall steps took ${end.getTime() - start.getTime()}ms` ); - process.exit(errored ? 1 : 0); + process.exit(0); } })();