Skip to content

Conversation

@HariniMalothu17
Copy link
Contributor

@HariniMalothu17 HariniMalothu17 commented Jan 15, 2026

Description

The rnw-dependencies.ps1 script fails to install Node.js with the error:

WARNING: There was a problem trying to install Node.js (LTS, >= 22.0)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

  • The script requests version 22.14.0 from OpenJS.NodeJS.LTS, but this is a rolling package that now only contains 24.x versions (22.14.0 exists in OpenJS.NodeJS.22, not .LTS)
  • After installing tools via winget, the PATH isn't refreshed in the current session, so validation fails
  • Winget returns non-zero exit codes for valid scenarios like "already installed", which the script treats as failure

Resolves [Add Relevant Issue Here]

What

  • Removed hardcoded Node.js version - Now installs latest LTS instead of a specific version that may not exist
  • Added PATH refresh after winget install - Newly installed tools are immediately available without restarting the terminal
  • Added re-validation after install - Checks if the tool actually works instead of relying solely on winget's exit code

Testing

tested on a new vm .Worked as expected
image

Changelog

Should this change be included in the release notes: no

Add a brief summary of the change to use in the release notes for the next release.

Microsoft Reviewers: Open in CodeFlow

@HariniMalothu17 HariniMalothu17 requested review from a team as code owners January 15, 2026 10:20
Copy link
Contributor

@vineethkuttan vineethkuttan left a comment

Choose a reason for hiding this comment

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

You have to change the in samples and update the website
https://microsoft.github.io/react-native-windows/docs/rnw-dependencies

image

Tags = @('appDev');
Valid = { CheckNode; }
Install = { WinGetInstall OpenJS.NodeJS.LTS "22.14.0" };
Install = { WinGetInstall OpenJS.NodeJS.LTS };
Copy link
Contributor

Choose a reason for hiding this comment

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

https://endoflife.date/nodejs

node 22's latest version updated to 22.22.0

removing version will install node 24 I believe, because that is the latest LTS.

replace 22.14.0 with 22.22.0

@HariniMalothu17
Copy link
Contributor Author

You have to change the in samples and update the website https://microsoft.github.io/react-native-windows/docs/rnw-dependencies

image

microsoft/react-native-windows-samples#1132
I have raised pr to update in documentation

Copy link
Contributor

@iamAbhi-916 iamAbhi-916 left a comment

Choose a reason for hiding this comment

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

LGTM!

@iamAbhi-916
Copy link
Contributor

You have to change the in samples and update the website https://microsoft.github.io/react-native-windows/docs/rnw-dependencies

image

Is this done?

@HariniMalothu17 HariniMalothu17 enabled auto-merge (squash) January 27, 2026 09:50
@HariniMalothu17 HariniMalothu17 merged commit 596a0a2 into microsoft:main Jan 27, 2026
30 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 27, 2026
* Fix rnw-dependencies.ps1 Node.js installation failures

* Change files

* Fix node.js version

* update command

---------

Co-authored-by: Harini Malothu <hmalothu@microsoft.com>
iamAbhi-916 added a commit that referenced this pull request Jan 27, 2026
* Fix rnw-dependencies.ps1 Node.js installation failures

* Change files

* Fix node.js version

* update command

---------

Co-authored-by: Harini Malothu <185761277+HariniMalothu17@users.noreply.github.com>
Co-authored-by: Harini Malothu <hmalothu@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants