Conflict: dev-config installs nvm4w but TypeScript workload installs Node.js LTS directly
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- node.js, powershell, typescript
研究方向
比較 dev-config.winget 與 Workloads/typescript/configuration.winget,然後在 PATH 處理屬於所選方案一部分的情況下檢查 refresh-path.ps1。在 Windows 上套用這兩項設定,並驗證在新的終端機中可以使用 node --version 和 npm,且不存在彼此衝突的 Node 安裝;所選的協調策略應明確且可重現。
由索引模型根據 Issue 內容生成。
描述
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)
- 主要語言
- PowerShell
- 星號
- 2.2k
- 分支
- 168
- 平均合併
- 5 小時 14 分鐘
- 30 天內合併 PR
- 5
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/WindowsDeveloperConfig 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
microsoft/WindowsDeveloperConfig#100 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 35/100
-
難度 3/5 1-2 天 新手友好度 45/100
microsoft/WindowsDeveloperConfig#84 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 42/100
microsoft/WindowsDeveloperConfig#57 · 3 則留言 ·
查看 microsoft/WindowsDeveloperConfig 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
use-agent-os/agent-os#3314 ·
-
documentation low-priority templates
難度 2/5 1-3 小時 新手友好度 85/100
jesseray718/openroot#87 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
難度 2/5 1-3 小時 新手友好度 84/100
-
難度 2/5 1-3 小時 新手友好度 90/100
danielmiessler/LifeOS#2218 ·
-
in-progress proposal
難度 1/5 1 小時以內 新手友好度 88/100
uibcdf/molsyssuite#36 ·