Repository navigation
Windows WinGet configuration failures (Failed to create instance: -2147023174) #66755
Description
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 microsoft/winget-cli#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 foundC:\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.yamlLogs
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
- Add requirement to run as PowerShell Administrator to 2: Automated install with WinGet
- Monitor resolution of issue Get-WinGetPackage in 1.29.380 fails with "Failed to create instance: -2147023174" in an elevated PowerShell session microsoft/winget-cli#6560
Activity