Skip to content

fix(ng-dev/release): silence nvm which command output during release verification#3662

Merged
josephperrott merged 1 commit into
angular:mainfrom
josephperrott:fix-nvm-which-silent
May 12, 2026
Merged

fix(ng-dev/release): silence nvm which command output during release verification#3662
josephperrott merged 1 commit into
angular:mainfrom
josephperrott:fix-nvm-which-silent

Conversation

@josephperrott
Copy link
Copy Markdown
Member

Suppresses unwanted output to stdout during nvm node path resolution by passing the --silent flag to nvm which.

@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label May 12, 2026
@josephperrott josephperrott requested a review from mattrbeck May 12, 2026 19:53
@josephperrott josephperrott merged commit 6ef1cf3 into angular:main May 12, 2026
12 checks passed
@josephperrott
Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the nvm command in external-commands.ts to include the --silent flag. Feedback indicates that the command uses bash-specific features incompatible with Windows and that the --silent flag requires nvm v0.39.0 or newer, which may cause issues for users on older versions.

// We redirect stdout of nvm install to stderr so that stdout only contains the result of nvm which.
const {stdout} = await ChildProcess.spawn(
'. ~/.nvm/nvm.sh && nvm install >&2 && nvm which',
'. ~/.nvm/nvm.sh && nvm install >&2 && nvm which --silent',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command string uses several bash-specific features (e.g., the . built-in, the ~ home directory shortcut, and sourcing a .sh file) which are not compatible with Windows. This violates the general rule that ng-dev tooling should be compatible with Windows.

Additionally, please note that the --silent flag for nvm which was introduced in nvm v0.39.0. If users are running an older version of nvm, this command will treat --silent as a version argument, fail to find it, and print an error to stdout, which would break the nodeBinPath detection.

References
  1. ng-dev tooling is expected to be compatible with Windows.

@josephperrott josephperrott deleted the fix-nvm-which-silent branch May 12, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants