From 552a885618e9539091f3e95bf3cfed447b8f94a2 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Mon, 4 Aug 2025 21:23:10 -0600 Subject: [PATCH] fix(js): handle npm 11 warnings in stderr during registry version resolution npm 11+ (bundled with Node 24.3) writes deprecation warnings about unknown environment configurations to stderr even when commands succeed. The registry version resolver was incorrectly rejecting any npm view command with stderr content, causing e2e tests to fail with Node 24.3. This change updates the error handling to only reject on actual errors, ignoring npm warning messages that start with 'npm warn'. --- packages/js/src/release/version-actions.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/js/src/release/version-actions.ts b/packages/js/src/release/version-actions.ts index 9b4d8f2c7d4bd..e1b81f69e0b09 100644 --- a/packages/js/src/release/version-actions.ts +++ b/packages/js/src/release/version-actions.ts @@ -111,7 +111,15 @@ export default class JsVersionActions extends VersionActions { if (error) { return reject(error); } - if (stderr) { + // Only reject on stderr if it contains actual errors, not just npm warnings + // npm 11+ writes "npm warn" messages to stderr even on successful commands + if ( + stderr && + !stderr + .trim() + .split('\n') + .every((line) => line.startsWith('npm warn')) + ) { return reject(stderr); } return resolve(stdout.trim());