Last active
February 10, 2021 20:51
-
-
Save zleight1/292d2dc1cf78c8b49c0d8e66a6a37b2e to your computer and use it in GitHub Desktop.
Script to download and fix npm windows-build-tools C++ deps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TempDir = "C:\temp\windows-build-tools" | |
If(!(test-path $TempDir)) | |
{ | |
New-Item -ItemType Directory -Force -Path $TempDir | |
} | |
$client = new-object System.Net.WebClient; | |
$client.DownloadFile("https://aka.ms/vs/16/release/vs_buildtools.exe","$TempDir\vs_buildtools.exe"); | |
cd "$TempDir"; | |
.\vs_buildtools.exe --passive --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --locale en-US --noUpdateInstaller | Out-Null; | |
npm i -g --production windows-build-tools; | |
npm i -g node-gyp; | |
npm i node-expat; | |
cd C:\; | |
Get-ChildItem -Path $TempDir -Recurse | Remove-Item -force -Recurse -ErrorAction SilentlyContinue | |
Remove-Item $TempDir -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/zleight1/292d2dc1cf78c8b49c0d8e66a6a37b2e/raw/fix-windows-build-tools.ps1'))