From db06a24025d57f511c1313b24bc9c8e3e1275404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Wouts?= Date: Mon, 16 Oct 2023 12:08:44 +1100 Subject: [PATCH] fix: catch non-zero exit code for pnpm install See #2108. --- loader/src/modules.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loader/src/modules.ts b/loader/src/modules.ts index 0548b3ac864..04c5bc43085 100644 --- a/loader/src/modules.ts +++ b/loader/src/modules.ts @@ -29,7 +29,8 @@ export async function loadModules({ ); pnpmProcess.stdout?.on("data", (chunk) => process.stdout.write(chunk)); pnpmProcess.stderr?.on("data", (chunk) => process.stderr.write(chunk)); - if ((await pnpmProcess).failed) { + const pnpmResult = await pnpmProcess; + if (pnpmResult.failed || pnpmResult.exitCode !== 0) { throw new Error(`Unable to install dependencies`); } // Note: The bracketed tag is required for VS Code and IntelliJ to detect end of installation.