Skip to content

Instantly share code, notes, and snippets.

@asanchezr
Last active June 12, 2018 19:35
Show Gist options
  • Save asanchezr/738e6e9e94db8ecc873fa05213cb099d to your computer and use it in GitHub Desktop.
Save asanchezr/738e6e9e94db8ecc873fa05213cb099d to your computer and use it in GitHub Desktop.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe"

https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules

There are three primary reasons you might be interested in this section:

  • you have an existing C++ library you'd like to take advantage of in your Node.js application
  • you are interested in optimizing the performance of some code by writing it in C++
  • you're running into dreaded node-gyp issues and have no idea what's going on.

Identifying native modules

How do you know if an npm package you want to install is a native module? Look for nan, node-gyp, or node-pre-gyp dependencies.

Environment setup and configuration:

Prerequisites

  • Option 1:

    Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).

  • Option 2:

    Install dependencies and configuration manually

    1. Visual C++ Build Environment:
      • Option 1: Install Visual C++ Build Tools using the Default Install option.
      • Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.

💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1

  1. Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7
  2. Launch cmd, npm config set msvs_version 2015

Verify everything's working

Here are a few packages you can try installing to see if your environment is set up properly.

  • bson
  • bufferutil
  • kerberos
  • node-sass
  • sqlite3
  • phantomjs
  • utf-8-validate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment