Skip to content

Commit 98ee167

Browse files
authored
fix(js): handle npm 11 warnings in stderr during registry version resolution (#32223)
## Current Behaviour E2e tests fail with Node 24 because npm 11 writes deprecation warnings to stderr even on successful commands, causing registry version resolution to fail. ## Expected Behaviour Registry version resolution should work with npm 11 warnings in stderr. ## References ``` NX Unable to resolve the current version from the registry: "registry=http://localhost:4873" tag=latest. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails. ``` https://staging.nx.app/runs/l9kRV3E6ST
1 parent ffb8547 commit 98ee167

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)