microsoft / microsoft/WindowsDeveloperConfig

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

Aperta
#55 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
PowerShell
Stelle
2.2k
Fork
168
Merge medio
5h 14m
PR unite (30g)
5

Descrizione

Summary

The main dev-config.winget installs NVM for Windows (CoreyButler.NVMforWindows), which manages Node.js versions via a symlink at C:\nvm4w\nodejs and adds that to PATH. However, the TypeScript workload (Workloads/typescript/configuration.winget) separately installs OpenJS.NodeJS.LTS directly via winget, which places Node at C:\Program Files\nodejs.

This creates a broken state where:

  1. PATH points to C:\nvm4w\nodejs (set by nvm4w)
  2. The nvm4w symlink targets a version directory (e.g. C:\Users\<user>\AppData\Local\nvm\v24.16.0) that does not exist because Node was installed via the MSI package, not through nvm install
  3. node and npm are not found on PATH despite Node.js being physically installed

Steps to Reproduce

  1. Apply the main windows-dev-config/dev-config.winget (installs nvm4w, adds C:\nvm4w\nodejs to PATH)
  2. Apply Workloads/typescript/configuration.winget (installs OpenJS.NodeJS.LTS to C:\Program Files\nodejs)
  3. Open a new terminal
  4. Run node --versioncommand not found

Root Cause

nvm4w owns the PATH entry (C:\nvm4w\nodejs) and expects Node to be installed via nvm install <version> + nvm use <version>. The direct winget install of OpenJS.NodeJS.LTS puts node elsewhere and nvm4w's symlink points to a non-existent directory.

Suggested Fix

Option A — TypeScript workload defers to nvm4w:
Replace the OpenJS.NodeJS.LTS winget package resource with a RunCommandOnSet that runs:

nvm install lts
nvm use lts

Option B — Remove nvm4w from dev-config, let workloads install Node directly:
Remove CoreyButler.NVMforWindows from dev-config.winget and ensure C:\Program Files\nodejs ends up on PATH (the Node MSI installer does this by default).

Option C — Keep both but coordinate PATH:
If both are intentional, the TypeScript workload should add C:\Program Files\nodejs to PATH explicitly, or the refresh-path.ps1 should detect and resolve the nvm4w symlink conflict.

Environment

  • Windows 11 (Build 2026)
  • winget v1.28.240
  • CoreyButler.NVMforWindows 1.2.2
  • OpenJS.NodeJS.22 24.16.0 (installed by winget as the LTS package)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Confronta dev-config.winget con Workloads/typescript/configuration.winget, quindi esamina refresh-path.ps1 se la gestione di PATH fa parte dell’approccio scelto. Applica entrambe le configurazioni su Windows e verifica che node --version e npm siano disponibili in un nuovo terminale senza installazioni di Node in conflitto; la strategia di coordinamento selezionata deve essere esplicita e riproducibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
node.js, powershell, typescript
Ambito
developer-experience, devops, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.