Skip to content

Commit 552a885

Browse files
committed
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'.
1 parent b88664f commit 552a885

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/js/src/release/version-actions.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,15 @@ export default class JsVersionActions extends VersionActions {
111111
if (error) {
112112
return reject(error);
113113
}
114-
if (stderr) {
114+
// Only reject on stderr if it contains actual errors, not just npm warnings
115+
// npm 11+ writes "npm warn" messages to stderr even on successful commands
116+
if (
117+
stderr &&
118+
!stderr
119+
.trim()
120+
.split('\n')
121+
.every((line) => line.startsWith('npm warn'))
122+
) {
115123
return reject(stderr);
116124
}
117125
return resolve(stdout.trim());

0 commit comments

Comments
 (0)