Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting node-gyp to work on windows can be a bit of a hassle. This gist shows the exact steps.

Steps

  1. Download Visual Studio 2017 with "Desktop development with C++" workload and the default components selected.
  2. Add msbuild to PATH. For me its this directory: D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin.
  3. Install node-gyp globally: npm i -g node-gyp
  4. Python 2.7
    • Download python2.7
    • Install to C:\Python27
    • Rename python.exe to python2.exe
    • Add C:\Python27 to PATH
  5. npm config set python python2.7
  6. npm config set msvs_version 2017

NOTE

If using msys2 chances are python2 is already there in /usr/bin. That version wont work. To force using the windows version add it to start of PATH:

PATH=/c/Python27:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.