Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

mousetraps
Copy link
Contributor

  • Point to new VC++ Build Tools Technical Preview.
  • Simplify and consolidate install instructions for all Windows versions.

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.

  • bson
  • bufferutil
  • kerberos
  • node-sass
  • node_sqlite3
  • phantomjs
  • utf-8-validate

cc: @orangemocha, @jasonwilliams200OK, @thealphanerd, @am11, @mluparu

* Point to new VC++ Build Tools Technical Preview.
* Simplify and consolidate install instructions for all Windows versions.
@mcollina
Copy link
Member

👍 for me.

@am11
Copy link

am11 commented Jan 18, 2016

👍 for simplification. LGTM.

@rvagg
Copy link
Member

rvagg commented Jan 18, 2016

/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.
Copy link
Contributor

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?

Copy link
Contributor

@MylesBorins MylesBorins May 13, 2016

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)

@orangemocha
Copy link
Contributor

One minor nit, feel free to take it or leave it. LGTM

@domenic
Copy link

domenic commented Jan 18, 2016

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.

@ralphtheninja
Copy link
Contributor

Nice!

@MylesBorins
Copy link
Contributor

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

@rvagg
Copy link
Member

rvagg commented Jan 18, 2016

@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 master.

@domenic
Copy link

domenic commented Jan 18, 2016

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

@rvagg
Copy link
Member

rvagg commented Jan 18, 2016

@domenic good questions, that I will have to defer to @orangemocha and @joaocgreis on.

/cc @nodejs/build

@am11
Copy link

am11 commented Jan 19, 2016

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

@domenic
Copy link

domenic commented Jan 19, 2016

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

@orangemocha
Copy link
Contributor

@domenic good points. We can and should definitely add the VC++ build tools in CI for node builds. I'll give that a try...

@Sogl
Copy link

Sogl commented Jan 20, 2016

👍

@bnoordhuis
Copy link
Member

Reviewers, is this PR good to land?

@orangemocha
Copy link
Contributor

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.

@MylesBorins
Copy link
Contributor

@orangemocha any movement here? I think I'll be getting a windows box soon and can help if this is blocked

@orangemocha
Copy link
Contributor

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.

@MylesBorins
Copy link
Contributor

@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!!!

@dalinwilliams
Copy link

@mousetraps

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!

@bsclifton
Copy link

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)

@bsclifton
Copy link

@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?
https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/

@mousetraps
Copy link
Contributor Author

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!

@MylesBorins
Copy link
Contributor

amazing @mousetraps!

I'll go through with a fresh VM and see if I can get things working following this guide

@orangemocha
Copy link
Contributor

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

@MylesBorins
Copy link
Contributor

To get things working with option 1 I had to run the command npm set msvs_version 2015

Should this be added to the instructions? Is it needed for the other options?

@mousetraps
Copy link
Contributor Author

mousetraps commented May 13, 2016

@thealphanerd already there! (might be easier to view the .md rendering than the diff itself https://github.com/mousetraps/node-gyp/tree/629#installation)

@MylesBorins
Copy link
Contributor

womp... I lose at reading comprehension once again... I will blame it on reading markdown instead of the rendered output.

LGTM!

@orangemocha
Copy link
Contributor

orangemocha commented May 17, 2016

Landed in 0880827, with a slightly reworded commit message.

orangemocha pushed a commit that referenced this pull request May 17, 2016
* 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 <orangemocha@nodejs.org>
Reviewed-By: thealphanerd - Myles Borins <myles.borins@gmail.com>
@mscdex
Copy link
Contributor

mscdex commented May 31, 2016

I'm curious, does this mean that vs2013 will no longer work or be sufficient or ?

@rvagg rvagg mentioned this pull request Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.