20

As part of trying to use a node NPM dependency in a project, I get a node-gyp rebuild issue, which I have reported.

I am aware of the solution in this SO question, but it does not work for Windows 10 (I am on 32 bits, I don't know whether this is relevant). Windows SDK 7.1 (and others) won't install.

Does anyone have an operational solution for Windows 10?

Udpate

After trying npm install <module name> --msvs_version=2013, I get a new error message:

enter image description here

5
  • Do you have Visual C++ (Express) installed?
    – mscdex
    Sep 8, 2015 at 12:31
  • I have Visual C++ 2005, 2008, 2010, 2012, 2013 Redistributable (all x86) installed, but no Express versions installed. Sep 8, 2015 at 12:51
  • You might try npm install <module name> --msvs_version=2013. That should force node-gyp to explicitly use VC++2013 instead of trying to autodetect.
    – mscdex
    Sep 8, 2015 at 15:03
  • I am getting a new error message. See update in the question. Sep 8, 2015 at 17:43
  • Oh, my mistake, I misread what you had typed. You need to install at least VC Express (make sure it's the "Windows Desktop" edition) and not just the VC runtime/redistributable.
    – mscdex
    Sep 8, 2015 at 19:52

3 Answers 3

10

This worked for me:

npm install --global --production windows-build-tools
1
  • 2021 update - the author marked this as deprecated sometime mid-2021 saying that node now has the installation of these tools built in. However, note that during the windows node installation you have to check the box that allows it to install it with chocolatey if you want this.
    – MikeyT
    Nov 23, 2021 at 20:29
8

I solved this problem on windows 8 and windows 10 pro with this tutorial. I try a lot of times to solve this problem with many different solutions, but only worked for me this
I notice that i didn't use nodist to control the node version like this tutorial, I use NVM and worked fine, i don't test this tutorial with nodist. I used node 5.2.0.

Edit:

Following the suggested by @prasun, the steps in correct order:

  • Download and install Git SCM from HERE
  • Download Visual Studio Community HERE and install a Custom Installation, selecting ONLY the following packages: VISUAL C++, PYTHON TOOLS FOR VISUAL STUDIO and MICROSOFT WEB DEVELOPER TOOLS
  • Download and install Python 2.7.x from HERE
  • Register a Environment Variable with name: GYP_MSVS_VERSION with this value: 2015.

This is the only steps work for me in windows 8.1 and windows 10.

1
  • 2
    please add description from link, in case it goes down
    – prasun
    Dec 28, 2015 at 17:12
5

To install node addons, you need to have VC/VCExpress installed and not just the VC runtime/redistributable. Make sure it's the "Windows Desktop" edition.

After that, you should be able to install addons via npm (you may have to re-open any command prompts you had open before installing VCExpress though).

1
  • 2
    how to Make sure it's the "Windows Desktop" edition ? Nov 4, 2015 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.