microsoft / microsoft/WindowsDeveloperConfig
Conflict: dev-config installs nvm4w but TypeScript workload installs Node.js LTS directly
Personne n'a encore pris cette issue.
- Langage dominant
- PowerShell
- Étoiles
- 2.2k
- Forks
- 168
- Merge moyen
- 5 h 14 min
- PR mergées (30 j)
- 5
Description
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:
- PATH points to
C:\nvm4w\nodejs(set by nvm4w) - 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 throughnvm install nodeandnpmare not found on PATH despite Node.js being physically installed
Steps to Reproduce
- Apply the main
windows-dev-config/dev-config.winget(installs nvm4w, addsC:\nvm4w\nodejsto PATH) - Apply
Workloads/typescript/configuration.winget(installsOpenJS.NodeJS.LTStoC:\Program Files\nodejs) - Open a new terminal
- Run
node --version→ command 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)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Comparez dev-config.winget avec Workloads/typescript/configuration.winget, puis examinez refresh-path.ps1 si la gestion de PATH fait partie de l’approche choisie. Appliquez les deux configurations sous Windows et vérifiez que node --version et npm sont disponibles dans un nouveau terminal sans installations de Node en conflit ; la stratégie de coordination sélectionnée doit être explicite et reproductible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- node.js, powershell, typescript
- Domaine
- developer-experience, devops, tooling
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100