How to solve 'node-gyp rebuild' issue on Windows 10?

我们两清 提交于 2019-12-30 16:27:47

问题


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:


回答1:


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).




回答2:


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.




回答3:


This worked for me:

npm install --global --production windows-build-tools


来源:https://stackoverflow.com/questions/32457761/how-to-solve-node-gyp-rebuild-issue-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!