-
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
#629 Update and consolidate Windows install instructions #867
Conversation
* Point to new VC++ Build Tools Technical Preview. * Simplify and consolidate install instructions for all Windows versions.
👍 for me. |
👍 for simplification. LGTM. |
/cc @nodejs/platform-windows any additional help reviewing would be appreciated |
* Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.) | ||
* Launch cmd, `npm config set msvs_version 2015` | ||
|
||
If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep this paragraph with the bulleted list to make it clear that it still pertains to Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just finished trying to follow these steps with the following windows / node / npm versions
npm ERR! Windows_NT 10.0.14332
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "heapdump"
npm ERR! node v4.4.4
npm ERR! npm v2.15.1
I received the error
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
edit: I had followed option 1. to install visual c++ build tools. In order to get gyp to work correctly I needed to include the flag --msvs_version=2015
I was able to make this a permanent setting with the command npm set msvs_version 2015
This should likely be added to the guide for option 1 (not sure if it is needed for the other options)
One minor nit, feel free to take it or leave it. LGTM |
Do these actually work? Last I checked V8 failed to compile with 2015 every once in a while, especially on x64. The issue is that 2015 is not yet supported in the Chromium build pipeline so it gets broken every once in a while as changes are committed that fail in 2015. And the VC++ Build Tools are definitely not tested. That said, if our current release works using both these configurations, and we have both of them in CI, then this is nice. But we should not recommend configurations that are not actively tested in CI on every commit. |
Nice! |
@mousetraps thank you so much for putting this together. I'm on the slopes of Tahoe today, but I'll follow these instructions to provision a Windows box tomorrow. |
@domenic we have vs2015 as part of our CI set now so it's regularly tested for Node.js releases: https://ci.nodejs.org/job/node-compile-windows/, if the build part gets broken in vs2015 then we'd notice it, so far I'm not aware of anything causing problems with stable V8 as it lands in |
@rvagg That sounds like a good start. Do you have VS2015 doing x64 builds in particular? And do you have builds created with the VC++ Build Tools suggested in this PR? Mainly I just don't think we should recommend anything that isn't tested in CI. |
@domenic good questions, that I will have to defer to @orangemocha and @joaocgreis on. /cc @nodejs/build |
@domenic, FWIW, VCBuildTools is packing the same version of cl.exe, link.exe etc. as VS2015 Update 1. So as such VCBuildTools is a subset of VS2015Update1. |
@am11 yep, which is what worries me. If it were a superset I'd imagine there are no problems, but as a subset it might not be sufficient to build---it isn't yet for V8, if I recall the bugs. Or maybe that's Chrome... |
@domenic good points. We can and should definitely add the VC++ build tools in CI for node builds. I'll give that a try... |
👍 |
Reviewers, is this PR good to land? |
Not just yet. We ran into some issues building Node itself with the VC++ build tools and we are trying to figure out a way to fix it in the tools or update the instructions to avoid trouble for those users who also build Node. We should have an update shortly. |
@orangemocha any movement here? I think I'll be getting a windows box soon and can help if this is blocked |
hey @thealphanerd , nice to hear that you'll be working on Windows and thanks for the offer to help! So the Visual C++ Build Tools (aka VCBT) have been in Node CI for quite some time but in the process of adding them we discovered an issue with the environment scripts that required some hacking to set up the environment. The issue was fixed in Update 2, but there is still an issue that prevents from building Node when the repo is on a different drive than the VCBT. Note that this doesn't affect building modules. So in summary this change is almost ready to go, but it would need at least an updated link to the most recent update, and I would prefer for it to have a disclaimer to continue using full VS for users who also build Node. BUT, another pre-release update is supposed to come out at the end of March with the fix for the drive issue, so at this point it might be easier to just wait until then. |
@orangemocha thanks for the update! @mousetraps thanks for the patience. This is really going to help a lot of people when it becomes the standard documentation!!! |
Thanks for this update! I'm working on getting this to work on Nano Server, the interface-less version of windows server. Other than the VC Build Tools, can you think of anything else to run in order to get node-gyp to work on Nano? Thanks everyone! |
Changes look good 👍 The only thing I'd suggest would be a troubleshooting section. I think many people (like me) don't have a clean install and MSBuild ends up not resolving things properly. More details about that in #679 (comment) |
@orangemocha @mousetraps - looks like the official release for the Visual C++ Build Tools 2015 happened 😃 I think the PR needs to be updated (under option 1) to link to it, then this should be ready, right? |
Hey everyone, just updated the readme to point to the new version of the Visual C++ build tools, and also removed the requirement to use a custom install because we've addressed that in the product. Lmk if there's anything else! |
amazing @mousetraps! I'll go through with a fresh VM and see if I can get things working following this guide |
Awesome! The VC++ build tools have been used in Node's CI for quite some time now, and @joaocgreis and I have also tested this latest version. LGTM |
To get things working with option 1 I had to run the command Should this be added to the instructions? Is it needed for the other options? |
@thealphanerd already there! (might be easier to view the .md rendering than the diff itself https://github.com/mousetraps/node-gyp/tree/629#installation) |
womp... I lose at reading comprehension once again... I will blame it on reading markdown instead of the rendered output. LGTM! |
Landed in 0880827, with a slightly reworded commit message. |
* Point to the latest release of the VC++ Build Tools. * Simplify and consolidate install instructions for all Windows versions. PR-URL: #867 Fixes: #629 Reviewed-By: orangemocha - Alexis Campailla <[email protected]> Reviewed-By: thealphanerd - Myles Borins <[email protected]>
I'm curious, does this mean that vs2013 will no longer work or be sufficient or ? |
As described in #629 (comment), the new VC++ build tools provide a minimal set of C++ dependencies on Windows, so there is no longer a need to install full-blown VS. The Build Tools are currently in Technical Preview, but so far folks on the thread have pretty good success with them so far. Currently it is necessary to install both the Windows 8.1 & Windows 10 SDKs, but at RTM, the more minimal default install should be sufficient.
I also went ahead and generally simplified / consolidated the instructions because some of them were too complex, some of them were too sparse, and the repetition was just plain unnecessary & confusing. Additionally I added a link to our Node.js Guidelines for Windows, which provides additional helpful tips.
I've tested both the Technical Preview and VS2015 Community instructions on Windows 7, 8, 8.1, and 10 with the following packages.
cc: @orangemocha, @jasonwilliams200OK, @thealphanerd, @am11, @mluparu