I'm working on an Angular application and had to recently re-install my node_modules. This means installing node-sass which in turn uses node-gyp (python and c++) to build some native modules.
The node-gyp build kept failing as it couldn't find the MSBuild.exe in the location it expected. Turns out the in Visual Studio 2019, the location (and convention) has changed.
But in the meantime, I found a comment on the issue where someone wrote a nifty Powershell script that creates a shim EXE in the location node-gyp expects, but forwards the command to the actual msbuild.exe. Problem solved until it can be fixed properly.
You can find the script here: https://gist.github.com/noseratio/d81888eda77620e526c7eb2c3b75cba8
- Copy it into a text document and name something like
- Open a PowerShell prompt as Administrator
- Re-run your