Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(dev-config): activate Node via nvm instead of conflicting MSI install (#55)#68

Open
primetimetank21 wants to merge 4 commits into
microsoft:main from
primetimetank21:squad/55-nvm-activation
Open

fix(dev-config): activate Node via nvm instead of conflicting MSI install (#55) #68
primetimetank21 wants to merge 4 commits into
microsoft:main from
primetimetank21:squad/55-nvm-activation

Conversation

@primetimetank21

@primetimetank21 primetimetank21 commented Jun 8, 2026
edited
Loading

Copy link
Copy Markdown

Summary

Fixes #55

Root cause: dev-config.winget installed both OpenJS.NodeJS.LTS (MSI) and CoreyButler.NVMforWindows in the same provisioning run. nvm4w prepends C:\nvm4w\nodejs (a junction) to the Machine PATH, but because nvm install was never called, the junction target was empty. In any new terminal, node resolved to the dead symlink (PATH priority) instead of the MSI install, producing "command not found". The conflict was internal to dev-config.winget itself, before any workload was applied.

Changes

File Change
src/windows-dev-config/dev-config.winget Remove NodeJS (OpenJS.NodeJS.LTS) MSI resource; keep nvmForNode; add NvmActivateNode PowerShellScript resource
src/windows-dev-config/README.md 13 apps -> 12 apps; remove NodeJS row; update nvmForNode row; clean up pinned-id references

Only the editable source under src/windows-dev-config/ is changed; the top-level signed release copies are regenerated by the sign pipeline (see src/docs/development.md) and are intentionally left untouched.

Fix detail

  • Remove the NodeJS (OpenJS.NodeJS.LTS) MSI resource -- eliminates the PATH race.

  • Keep nvmForNode (CoreyButler.NVMforWindows) as the canonical Node manager.

  • Add NvmActivateNode -- a Microsoft.DSC.Transitional/PowerShellScript resource with dependsOn: [nvmForNode]. Its three-phase setScript:

    1. Refresh $env:Path from Machine + User registry PATH so nvm is visible in the DSC process.
    2. Run nvm install 24 then nvm use 24 (throws on non-zero exit code).
    3. Refresh $env:Path again so node / npm are visible to downstream resources.

    The testScript also refreshes PATH and asserts nvm is on PATH and node --version matches ^v24\..

Node is pinned to major 24 (not the lts alias) to stay in sync with the cli-checks.ps1 assertion ^v24. and avoid LTS-drift failures when Node 26 eventually becomes LTS.

Acceptance criteria (cli-checks.ps1)

The three existing assertions remain valid and unchanged:

  • nvm version succeeds
  • node --version matches ^v24.
  • npm --version succeeds

Manual verification needed

nvm use 24 creates a filesystem junction at C:\nvm4w\nodejs, which requires elevation and Developer Mode. securityContext: elevated is set on NvmActivateNode. Please confirm junction creation succeeds on a real provisioning run.

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

...crosoft#55)
dev-config.winget installed both OpenJS.NodeJS.LTS (MSI) and
CoreyButler.NVMforWindows, but never ran nvm install / nvm use. nvm4w
owns the front of PATH via the C:\nvm4w\nodejs junction, which pointed
at nothing, so node failed with "command not found" in new terminals.
- Remove the OpenJS.NodeJS.LTS MSI resource (ends the PATH race)
- Keep CoreyButler.NVMforWindows as the canonical Node manager
- Add an NvmActivateNode DSC script that runs nvm install 24 + nvm use 24,
 refreshing PATH before and after so Node 24 is active for later steps
- Update both READMEs (13 -> 12 apps)
Node is pinned to major 24 to match the cli-checks.ps1 ^v24. assertion.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Author

Why this PR pins Node 24 rather than nvm install lts

Three reasons drove the decision to pin 24 explicitly:

  1. Repo upgrade pattern is deliberate manual bumps, not auto-tracking.
    The most recent example: PR Update Python pinned version from 3.13 to 3.14 #58 ("Update Python pinned version from 3.13 to 3.14", merged 2026年06月04日) advanced Python by swapping the explicit winget id (Python.Python.3.13Python.Python.3.14) and synchronizing the test assertion regex in the same commit — a deliberate pin bump, not a floating alias. Python (3.13 → 3.14, issue Move to latest Python version (3.13 -> 3.14) #22 ) and Java (21 → 25, issue Move to latest OpenJDK version (21 -> 25) #23 ) were each advanced via an explicit issue → PR → merge cycle. There is no auto-advancing version automation anywhere in the repo, so tracking lts would be out of step with how every other runtime version is managed here.

  2. The acceptance test hardcodes ^v24..
    src/tests/calm-os/cli-checks.ps1 asserts node --version against ^v24.. Pinning nvm install 24 keeps install, activation, and test internally consistent and deterministic — no hidden coupling to shift over time.

  3. lts has a latent failure date.
    Node 26 enters LTS on 2026年10月28日. After that date, nvm install lts would resolve to Node 26 and the existing ^v24. test would fail with zero code change. Pinning avoids that silent breakage.

The original OpenJS.NodeJS.LTS package was a quality signal ("stable LTS line, not bleeding-edge") rather than a policy commitment to auto-advance; the README's "(currently Node 24 LTS)" note reflects that v24 is the intended version, not a promise to follow whatever LTS resolves to.


Happy to be redirected: There's no written policy that explicitly rules out lts-tracking — this is an inference from observed practice. If the maintainers prefer nvm install lts, the right companion change would be updating the ^v24. test assertion to ^v[0-9]+\. (or similar) so the two stay in sync. Just let me know and I'll revise accordingly.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR resolves a broken Node.js setup caused by installing both the Node.js MSI and NVM for Windows in the same dev-config run, by standardizing on NVM and explicitly activating a Node 24 toolchain during provisioning.

Changes:

  • Removed the OpenJS.NodeJS.LTS package from dev-config.winget to avoid PATH/junction conflicts with NVM for Windows.
  • Added an idempotent DSC PowerShellScript resource (NvmActivateNode) that installs/uses Node major 24 via nvm.
  • Updated README docs to reflect the Node/NVM approach and package list changes.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
windows-dev-config/dev-config.winget Drops Node MSI install and adds a post-NVM activation script for Node 24.
src/windows-dev-config/dev-config.winget Mirror of the dev-config update (NVM-only + Node 24 activation).
windows-dev-config/README.md Updates documentation to reflect NVM-managed Node 24 and adjusts the apps list.
src/windows-dev-config/README.md Mirror of the README documentation update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread windows-dev-config/dev-config.winget Outdated
Comment thread windows-dev-config/dev-config.winget Outdated
Comment thread src/windows-dev-config/dev-config.winget
Comment thread src/windows-dev-config/dev-config.winget Outdated
Comment thread windows-dev-config/README.md Outdated
Comment thread src/windows-dev-config/README.md Outdated
primetimetank21 added a commit to primetimetank21/WindowsDeveloperConfig that referenced this pull request Jun 10, 2026
- NvmActivateNode: add PowerShell to dependsOn (matches file convention so pwsh 7 is present before the script runs)
- Drop misleading "LTS" wording from the Node 24 activation description (script pins by major, not the lts alias)
- README: add Windows Terminal to the app list and reframe the count as 11 core apps plus 2 optional (Oh My Posh, PowerToys)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- NvmActivateNode: add PowerShell to dependsOn (matches file convention so pwsh 7 is present before the script runs)
- Drop misleading "LTS" wording from the Node 24 activation description (script pins by major, not the lts alias)
- README: add Windows Terminal to the app list and reframe the count as 11 core apps plus 2 optional (Oh My Posh, PowerToys)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread windows-dev-config/dev-config.winget Outdated
Comment thread windows-dev-config/dev-config.winget Outdated
Comment thread windows-dev-config/dev-config.winget Outdated
...ivateNode
Addresses Copilot review on microsoft#68:
- Guard node --version with Get-Command in getScript/testScript so the
 DSC run doesn't throw before Node is activated.
- Switch the activation log line from Write-Host to Write-Information.
Applied to both mirror config files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

primetimetank21 commented Jun 12, 2026
edited
Loading

Copy link
Copy Markdown
Author

Need to go back and do the following:

  • Only edit the src/ as per dev guide (so revert top-level changes I made 😅)

@primetimetank21 primetimetank21 marked this pull request as draft June 12, 2026 14:44
...signed-copy edits (src/ only)
Conflict in src/windows-dev-config/dev-config.winget resolved: kept nvm-activation changes
(NvmActivateNode resource, NodeJS MSI removal, Node-24 pin, PowerShell dependsOn, Get-Command
guards, Write-Information) while incorporating main's silent-install additions. Top-level
windows-dev-config/{README.md,dev-config.winget} reverted to match main per src/docs/development.md
(signed release copies regenerated by sign pipeline; only src/ is editable source).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@primetimetank21 primetimetank21 marked this pull request as ready for review June 13, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Conflict: dev-config installs nvm4w but TypeScript workload installs Node.js LTS directly

2 participants

AltStyle によって変換されたページ (->オリジナル) /