-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 10: The build tools for v120 (Platform Toolset = 'v120') cannot be found. #679
Comments
Have you installed visual studio 2015 with visual C++? That helped for me. |
The above error is with MVS 2015 C++. Could not do anything here so I completely removed MVS 2015 and installed 2013 C++. Now it seems to have different error. The error is with too long path names (opened case in stack overflow, since its not node-gyp fault): http://stackoverflow.com/questions/31817447/windows-10-node-gyp-cannot-build-msbuild-failed-with-exit-code-1 Any ideas? |
I have same problem in Windows 10 with VS2015&SDK. |
If there were a +1 button, I'd be clicking it myself right now, but there's not, so I'm forced to pollute your issue with my comment. Please accept my humblest apologies. Windows 10 user. VS2015 and VS2013 both installed, and both with C++. utf-8-validate is the offender in my case too. |
I'm having problems with Windows 10. VS2015 community installed. I get the following error
|
Guys, this worked for me; add GYP_MSVS_VERSION=2013 to your user environment variables. |
@axefrog Thank you!!!!!! With Windows 8.1 and VS2015 SDK/C++ installed I had to use: GYP_MSVS_VERSION=2015 (so change the version to what you're using) |
BTW what SDK are people using? @pjquinn I now get this error instead:
Can anyone help? :( |
Maybe try VS2015 w/ C++ and set env variable: GYP_MSVS_VERSION=2015 I'm on win 8.1 though, not 10 |
@pjquinn that didn't work for me :-( |
@jayflux I also ended up installing beta npm@3 (using 3.3.0 currently), I'm not sure which of the above finally made it work, but it does now, at least on Win 8.1 |
@pjquinn finally got it working by uninstalling Visual Studio 2015 and installing 2013, then i ran
So 2013 deffo works on windows 10, not sure why 2015 fails |
@Jayflux what version of window, vs, and sdk are you using now? |
@zhaoyao91 |
@Jayflux confirmed. Your method works. I completely removed all Microsoft associated build tools from Add/Remove Program panel. Then fresh clean install of VS2013 with no addons.
It works. Tho, |
@Jayflux, thanks Finally, it woks for me, all I need are: and if both vs 2013 and vs 2015 are installed, set GYP_MSVS_VERSION=2013 I hope this will be helpful for others. |
Why would you close this without either (a) adequate documentation or (b) at least a fix to look in both locations? That's lazy. |
Yeah this should not be closed. For one support for VS 2015 should be available. I shouldn't have to uninstall and reinstall VS to get this thing to build |
I managed to build with VS 2015 Community Edition under Windows 10. Turns out Microsoft decided to move the C-Runtime library to be part of the Operating System. I had to manually add the new locations of the header and library files to the file located at %HOMEPATH%.node-gyp\0.12.7\common.gypi.
I didn't check why VS doesn't find it's C-Runtime by itself and there may be a fancier solution for this. For example I have to manually maintain the paths. But I was able to build socket.io with all dependencies. |
This is what worked for me on Windows 10 Pro (x64) with Visual Studio 2015: http://stackoverflow.com/q/32556295/1050784 |
Simply running |
The task for this ticket is for someone to find a fully working solution for windows 10 and document it. (at the moment there are still different solutions mentioned in this thread) This might involve getting a VM with windows 10 on it and starting from scratch. |
@Jayflux I am working on a blog for this currently. I am going to document the steps I took on my computer and the steps I took on a fresh VM. I will provide a link when it is done. |
Thanks @nullivex you're a hero |
@jasonwilliams200OK are you able to update the readme if thats the case? as i think you have the best knowledge of what to do. |
@Jayflux, actually those were published in Microsoft fork by @mousetraps at: https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#prerequisites. |
And we have a PR open (#867) to update the readme (ran into a few snags while adding to CI that we can hopefully address that in the next build tools release. So close! 😃) |
oh awesome, thanks @mousetraps! |
This is a nasty issue 😦 I am experiencing the same issue reported by the OP. My exact config:
The I performed the steps @mousetraps outlined here, notably:
npm config set python python2.7
npm config set msvs_version 2015 --global Just for fun, I've rebooted to make sure things take effect. Notice how it's using the path for V120, but likely passing msbuild the params for 140. I tried to work around this by doing the following:
None of these work. Why is VCTargetsPath being resolved to V120, and not V140? |
Glad I didn't give up- I believe I fully understand the issue 😄 Hopefully this helps someone and @mousetraps, you might consider adding this to #867 (or at least linking to this issue). The problemInstalling Visual Studio 2013 before or alongside installing Visual Studio 2015 will corrupt the default values used for MSBuild in the Windows registry. Specifically, it corrupts what MSBuild evaluates Supporting data
My work-aroundIn my case, I had uninstalled Visual Studio 2013, but I never uninstalled/re-installed Visual Studio 2015... I only modified an existing installation. I was able to force MSBuild to use Visual Studio 2015 by only doing the following:
At this point, it resolves to the correct version... although I experienced the error: For this, I copied the DLL from the MSBuild folder I renamed above. That fixed the issue. |
I've tried everything in the workaround except for the last step, since I've never had a I keep on experiencing the following error on
The packages Noe that this doesn't happen when I run But I should be able to run this from a normal PowerShell with posh-git as well. Any ideas? |
node-gyp: v3.4.0 for using vs2013 it's required the similar : how the hell should I understand which VC++ version a package require? Why node-gyp's script can not declare it?! Why node-gyp can find a working VC++ version on machine? |
These official guidelines resolved my problem: https://github.com/nodejs/node-gyp#installation For the summary, Properly install of Python2.7, C++ build tools, then walk through Resolving common issues section on the Microsoft's nodejs guideline should help. |
My problem was the MSBuild pointed by the PATH environment variable was not the expected version. Correct one is "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" (Visual Studio 2015 build tools installed)
Ran again npm install, and worked like a charm. |
The fix for me was to do this in Microsoft Visual Studio 2017: and then: project -> Retarget_solution After that, it built with no issues. |
https://www.npmjs.com/package/windows-build-tools npm install --global windows-build-tools Installs all dependencies as needed |
I believe this can be closed now. In general the recommendation is always to use the same Older versions of node were built with VS2013, since 6.3.0 I think VS2015 is used. |
Doesn't this mean in effect we only support building native modules on Windows with one version of Visual Studio? |
one should not mix, currently node binaries from nodejs.org are built with VS2015 and PlatformToolkit v140. But one can easily build node yourself with own version of VisualStudio and build modules as needed. |
This is twice as terrible if you don't have admin rights (installations are possible yet it might take a long time to be done) due to some corporative standards))))) |
closing due to staleness, windows support has evolved somewhat since this was opened, please open a new issue if there's a new specific thing that can be discussed |
I had this similar issue on windows 10 and node 11, npm install was failing due to node-gyp rebuild command was unable to complete. I tried every solution i could find including installing mvs 2015, python 2.7 nothing worked. |
What's the proper way to install node-gyp in 2022? Links: creativetimofficial/impact-design-system#24 |
node-gyp v9 is current. https://github.com/nodejs/node-gyp/releases https://github.com/nodejs/node-gyp/tree/main/docs#readme |
When installing package via NPM some module had dependency that fired
node-gyp rebuild
which spawns tons of errors:This is part of install which gets errors. I fallowed instruction on node-gyp install, however Windows 10 does not allow instal Windows 7 SDKs (I found and installed Windows 10 SDKs, with no efefct). Anyone had same issues?
The text was updated successfully, but these errors were encountered: