microsoft / microsoft/WindowsDeveloperConfig

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

Abierto
#55 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
PowerShell
Estrellas
2.2k
Forks
168
Merge medio
5 h 14 min
PR fusionados (30 d)
5

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Compara dev-config.winget con Workloads/typescript/configuration.winget y, a continuación, inspecciona refresh-path.ps1 si la gestión de PATH forma parte del enfoque elegido. Aplica ambas configuraciones en Windows y verifica que node --version y npm estén disponibles en un terminal nuevo sin instalaciones de Node en conflicto; la estrategia de coordinación seleccionada debe ser explícita y reproducible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
node.js, powershell, typescript
Área
developer-experience, devops, tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.