Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Windows WinGet configuration failures (Failed to create instance: -2147023174)

未關閉 適合新手
#66,755 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
62/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
shell, yaml

研究方向

從 BUILDING.md 中的 'Option 2: Automated install with WinGet' 章節開始。該章節告訴 Windows 使用者從 PowerShell 執行 .configurations 檔案,但沒有說明是否需要系統管理員權限。在提升權限與未提升權限的 shell 中,對其中一個 YAML 檔案執行 winget configure,重現 issue 中描述的兩種失敗模式。完成的標準是:該章節說明命令必須在提升權限的 PowerShell 中執行,並且針對剩餘的錯誤連結上游 winget-cli issue。

由索引模型根據 Issue 內容生成。

描述

doc install windows

Situation

The BUILDING > Windows Prerequisites documentation section 2: Automated install with WinGet describes using the .configurations files to install prerequisites on Microsoft Windows required for building Node.js.

The instructions say to use a PowerShell terminal, and do not specify if elevated (Admin) privileges are necessary.

If the configuration is run without Admin privileges, it fails to install Visual Studio:

VSComponents [vsComponents]
Loading the module for the configuration unit failed because it requires administrator privileges to run.

If the configuration is run with Admin privileges, it fails to determine the current state:

The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174

This error condition is also noted in issue https://github.com/microsoft/winget-cli/issues/6560

Steps to reproduce

On Windows 11 26H2:

From Windows Settings > Apps > Installed Apps delete any of:

  • Git
  • Microsoft Visual Studio Installer
  • Python
  • Python Installer
  • Python Launcher
  • Rust

Delete:

  • C:\Python* if found
  • C:\Program Files\NASM

Restart system

In a PowerShell 7 terminal window, execute:

git clone https://github.com/nodejs/node
cd node
winget configure .\.configurations\configuration.vsBuildTools.dsc.yaml

Logs

Microsoft Windows NT 10.0.26300.0 x64
Windows 11 26H2 (OS Build 26300.9711)
PowerShell 7.6.7
winget v1.29.380

PowerShell non-Admin
WinGetPackage [pythonPackage]
  Unit successfully applied.
WinGetPackage [vsPackage]
  Unit successfully applied.
VSComponents [vsComponents]
  Loading the module for the configuration unit failed because it requires administrator privileges to run.
WinGetPackage [rustPackage]
  Unit successfully applied.
WinGetPackage [gitPackage]
  Unit successfully applied.
WinGetPackage [nasmPackage]
  Unit successfully applied.
Some of the configuration was not applied successfully.
PowerShell Administrator
WinGetPackage [pythonPackage]
  The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174
<See the log file for additional details>
WinGetPackage [vsPackage]
  The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174
<See the log file for additional details>
WinGetPackage [rustPackage]
  The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174
<See the log file for additional details>
WinGetPackage [gitPackage]
  The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174
<See the log file for additional details>
WinGetPackage [nasmPackage]
  The configuration unit failed while attempting to test the current system state.
Failed to create instance: -2147023174
<See the log file for additional details>
VSComponents [vsComponents]
  This configuration unit was not run because a dependency failed or was not run.
Some of the configuration was not applied successfully.

Suggestion

主要語言
JavaScript
星號
122k
分支
39.9k
平均合併
3 天 22 小時
30 天內合併 PR
233

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodejs/node 的其他 Issue

查看 nodejs/node 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。