From 77cc8453ac81c0432b47dd19239b26aead31bc93 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:03:38 +0100 Subject: [PATCH] build,win: add WinGet Visual Studio 2022 Build Tools Edition config --- .../configuration.vsBuildTools.dsc.yaml | 54 +++++++++++++++++++ BUILDING.md | 22 ++++++-- 2 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 .configurations/configuration.vsBuildTools.dsc.yaml diff --git a/.configurations/configuration.vsBuildTools.dsc.yaml b/.configurations/configuration.vsBuildTools.dsc.yaml new file mode 100644 index 00000000000000..5434b44b3e0459 --- /dev/null +++ b/.configurations/configuration.vsBuildTools.dsc.yaml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/nodejs/node/blob/main/BUILDING.md#windows +properties: + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: pythonPackage + directives: + description: Install Python 3.14 + module: Microsoft.WinGet.DSC + allowPrerelease: true + settings: + id: Python.Python.3.14 + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Build Tools + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.BuildTools + source: winget + useLatest: true + - resource: Microsoft.VisualStudio.DSC/VSComponents + id: vsComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads and components + allowPrerelease: true + settings: + productId: Microsoft.VisualStudio.Product.BuildTools + channelId: VisualStudio.17.Release + includeRecommended: true + components: + - Microsoft.VisualStudio.Workload.VCTools + - Microsoft.VisualStudio.Component.VC.Llvm.Clang + - Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: gitPackage + directives: + description: Install Git + allowPrerelease: true + settings: + id: Git.Git + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: nasmPackage + directives: + description: Install NetWide Assembler (NASM) + allowPrerelease: true + settings: + id: Nasm.Nasm + source: winget + configurationVersion: 0.1.1 diff --git a/BUILDING.md b/BUILDING.md index 8559c2aa8b1cb7..c967d32e816f49 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -774,23 +774,37 @@ first and then reinstalling them again. ##### Option 2: Automated install with WinGet -[WinGet configuration files](https://github.com/nodejs/node/tree/main/.configurations) +[WinGet configuration files](./.configurations) can be used to install all the required prerequisites for Node.js development easily. These files will install the following [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) packages: * Git for Windows with the `git` and Unix tools added to the `PATH` * `Python 3.14` -* `Visual Studio 2022` (Community, Enterprise or Professional) -* `Visual Studio 2022 Build Tools` with Visual C++ workload, Clang and ClangToolset +* `Visual Studio 2022` (Build Tools, Community, Professional or Enterprise Edition) and + "Desktop development with C++" workload, Clang and ClangToolset optional components * `NetWide Assembler` -To install Node.js prerequisites from PowerShell Terminal: +The following Desired State Configuration (DSC) files are available: + +| Edition | DSC Configuration | +| ------------ | ------------------------------------------------------------------------------------------------ | +| Build Tools | [configuration.vsBuildTools.dsc.yaml](./.configurations/configuration.vsBuildTools.dsc.yaml) | +| Community | [configuration.dsc.yaml](./.configurations/configuration.dsc.yaml) | +| Professional | [configuration.vsProfessional.dsc.yaml](./.configurations/configuration.vsProfessional.dsc.yaml) | +| Enterprise | [configuration.vsEnterprise.dsc.yaml](./.configurations/configuration.vsEnterprise.dsc.yaml) | + +Use one of the above DSC files with +[winget configure](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure#configure-subcommands) +in a PowerShell Terminal to install Node.js prerequisites. +For example, using the DSC file for Visual Studio Community Edition, execute the following command line: ```powershell winget configure .\.configurations\configuration.dsc.yaml ``` +To add optional components for MSI or ARM64 builds, refer to [Option 1: Manual install](#option-1-manual-install). + ##### Option 3: Automated install with Boxstarter A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of