From 8f23e5a426e2e66eef355030b90537325af9c601 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 14:11:29 +0100 Subject: [PATCH] fix: use correct signal variable in nan-spec-runner install check (#48708) The install process spawn was not capturing its own signal variable, causing the error check to incorrectly reference the build signal instead. This could lead to: - Install termination by signal going undetected - False positive errors when build was killed but install succeeded This commit ensures the install signal is properly captured and checked, matching the pattern used for the build process. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: KinshukSS2 --- script/nan-spec-runner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 2abdfe85e91f..f757428af6ec 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -116,16 +116,16 @@ async function main () { return process.exit(buildStatus !== 0 ? buildStatus : signal); } - const { status: installStatus } = cp.spawnSync(NPX_CMD, [`yarn@${YARN_VERSION}`, 'install'], { + const { status: installStatus, signal: installSignal } = cp.spawnSync(NPX_CMD, [`yarn@${YARN_VERSION}`, 'install'], { env, cwd: NAN_DIR, stdio: 'inherit', shell: process.platform === 'win32' }); - if (installStatus !== 0 || signal != null) { + if (installStatus !== 0 || installSignal != null) { console.error('Failed to install nan node_modules'); - return process.exit(installStatus !== 0 ? installStatus : signal); + return process.exit(installStatus !== 0 ? installStatus : installSignal); } const onlyTests = args.only && args.only.split(',');