Skip to content

Instantly share code, notes, and snippets.

@lap00zza
Last active October 31, 2018 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lap00zza/12a16df03408c96a47e08161d2c39cd4 to your computer and use it in GitHub Desktop.
Save lap00zza/12a16df03408c96a47e08161d2c39cd4 to your computer and use it in GitHub Desktop.
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