From 989b41ccf8b0d3b15ebbabab6fb7ba2826a4bde5 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 12 Jan 2026 14:17:30 -0500 Subject: [PATCH] Fix an issue with running npm commands. --- .../rush/fix-rush-publish_2026-01-12-19-17.json | 11 +++++++++++ libraries/rush-lib/src/utilities/Npm.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 common/changes/@microsoft/rush/fix-rush-publish_2026-01-12-19-17.json diff --git a/common/changes/@microsoft/rush/fix-rush-publish_2026-01-12-19-17.json b/common/changes/@microsoft/rush/fix-rush-publish_2026-01-12-19-17.json new file mode 100644 index 00000000000..efcd84c45fb --- /dev/null +++ b/common/changes/@microsoft/rush/fix-rush-publish_2026-01-12-19-17.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "", + "type": "none", + "packageName": "@microsoft/rush" + } + ], + "packageName": "@microsoft/rush", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/utilities/Npm.ts b/libraries/rush-lib/src/utilities/Npm.ts index 1e9c83627a9..c031831cd9e 100644 --- a/libraries/rush-lib/src/utilities/Npm.ts +++ b/libraries/rush-lib/src/utilities/Npm.ts @@ -19,7 +19,7 @@ async function runNpmCommandAndCaptureOutputAsync( captureExitCodeAndSignal: true }); - if (signal !== undefined) { + if (signal) { throw new Error(`The npm command was terminated by signal: ${signal}. Output: ${stdout} ${stderr}`); } else if (exitCode !== 0) { throw new Error(`The npm command failed with exit code: ${exitCode}. Output: ${stdout} ${stderr}`);