Windows users are not happy.
It all started with this conversation.
As I said, I'm pretty much a newbie and I don't even know what node-gyp does, but what I DO know is that it's a pain to run Windows and install a project with node-gyp as a dependency. Some numbers:
It's bizarre that a nodejs developer needs to install visual studio (even the express edition) in order to be able to work on Windows. Even more bizarre is that I, as a .NET developer with full visual studio installed in my machine still can't download a bunch of projects that use this project.
With that being said, I'd like to know from all of you what should we do to make windows users fall in the pit of success? What are the alternatives? Does Microsoft can solve this in any way?
This issue is fixed (kinda)
@mousetraps pointed that Microsoft is shipping the C++ build tools separately now. Check here
Some updates on this gigantic thread
Absolutely non-official statement that @Microsoft is aware of this issue and seeing what can be done
@mousetraps said that this thread "is high on people's radar" at @Microsoft
Very good Q&A about noge-gyp issues on Windows and why they happen
@dekarguy took the time to answer some questions about what we all are going through
@ricmed205, what do you see in the following locations:
- C:\Program Files (x86)\Microsoft SDKs\Windows
- C:\Program Files (x86)\Microsoft SDKs\Windows Kits
@jasonwilliams200OK
I don't have C:\Program Files (x86)\Microsoft SDKs\Windows.
I have C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs and then a couple of folders there with some files in there. Is there a specific file I should be looking for?
@ricmed205, sorry the location is C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um\WinSock2.h. With Windows 10, the C runtime is part of OS. Do you have C:\Program Files (x86)\Windows Kits\10\Include\ directory?
@jasonwilliams200OK I found WinSock2.h at "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um"
@ricmed205, this means your SDK is installed properly.
For some reason, the SDK cannot be located on your system. It could be a registry value not set or gyp cannot locate the SDK (https://github.com/nodejs/node-gyp/issues/679#issuecomment-137970103). Before trying the hack for latter one, I would delete node-gyp in home directory: rmdir /s /q %HOMEPATH%\.node-gyp\ and retry installing selenium (that directory you deleted will be re-created). If the problem persists, then try the steps laid by @fresc81.
I finally got it working checking BOTH windows 10 SDKs and windows 8 SDK (I'm on win10) when installing the 2015 build tools. It seems that somehow the windows 10 SDKs is built on top of the windows 8 SDKs OR the windows 10 SDKs package has a bug that fails to add the correspondent registry values, and my system is simple using the windows 8 SDKs (when I added it later).
Also, I must point out that downloading the 2015 build tools installs a +2gb microsoft visual c++ tools and a 2.12gb development kit (plus the other redistributable packages). So ~4.5gb total files. Not sure the size of the complete VS install and if it is a net gain...
@jasonwilliams200OK thank you for your help! @igorpupkinable too!
@ricmed205, thanks for the info. So the clean steps for Windows 10 are:
- Install Windows 7, 8.1 or 10.
- Install node.js latest version.
- Install Python 2.7.
- Install Build Tools and make sure to check Windows 8 SDK.
Then try npm install selenium-webdriver.
If I get a chance, I will prepare three virtual machines with Windows 7, 8.1 and 10 to verify these four steps. If someone else has time, please feel free to take a a lead. If you don't use vagrant, then the virtual machines can be downloaded from https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/ (these are for web testers but we can install node.js, Python and Build Tools as well).
So ~4.5gb total files. Not sure the size of the complete VS install and if it is a net gain
I think 4.5GB is still less than Express for Desktop, Community or Professional editions of Visual Studio 2015. I think with Express, the size become 6-8GBs. With Community and Professionals, it is around 13GBs (based on the components selection to be installed).
Chiming in here: Part of this problem is that Microsoft insists on distributing their compilers with their bloated IDE.
@Qix-, news for you: https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245. Please READ before chiming in here.
@jasonwilliams200OK that hasn't been true for over a decade. Excuse me for not reading the entire discussion with > 200 very large comments.
@Qix- as far as i know till VS2008, they used to had build tools. They discontinued in VS2010 then bring it back in VS2015. Yeah its weird but its better than the bloated IDE, agree?
I just updated the description with an update about the fix
hi @jasonwilliams200OK
I got error :
Traceback (most recent call last):
File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 18, in gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Project\Gooddata\test\gdc-client\node_modules\grunt-gd-spriter\node_modules\node-gd
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
and
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-gd package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-gd
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! cwd D:\Project\Gooddata\test\gdc-client npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.24 npm ERR! code ELIFECYCLE
I think node-gd not support windows is the problem .
thanks
@luisrudge, My solution also works with 0.x.x versions (only) of Node.js and tested on clean Windows 7/8/10 installations. You can also add it to description.
@Sogl Let's stick with node v4+
Agreed with @luisrudge. The cpp build sku solution posted also works with node v0.x. Given the amount of contusion around this topic let's just stick with the simplest recommended way (cpp build sku) and one for when VS is already installed rather than trying to complicate things any further. Because if we provide too many options, people are just going to get even more frustrated trying all of them trying to get something to work even though that wasn't actually the issue they were running into. Sent from my Rotary Phone
_____________________________
From: Luís Rudge [email protected] Sent: Monday, November 16, 2015 7:48 PM Subject: Re: [node-gyp] Windows users are not happy. (#629) To: nodejs/node-gyp [email protected] Cc: Sara Itani [email protected]
@Sogl Let's stick with node v4+
— Reply to this email directly or view it on GitHub.
The mess of this thread is now part of the problem.
It would be good if there was a nice well written page summarising the issues and solutions.
There's a summary in the first post. What else would you like to see there?
De: dukedougalmailto:[email protected] Enviada em: 17/11/2015 08:15 Para: nodejs/node-gypmailto:[email protected] Cc: Luís Rudgemailto:[email protected] Assunto: Re: [node-gyp] Windows users are not happy. (#629)
The mess of this thread is now part of the problem.
It would be good if there was a nice well written page summarising the issues and solutions.
Reply to this email directly or view it on GitHub: https://github.com/nodejs/node-gyp/issues/629#issuecomment-157327549
@phthong,
The error you are seeing is reported in https://github.com/nodejs/node-gyp/issues/555 and I agree with others to consider updating node.js version to latest in 2 minutes by going to http://nodejs.org and clicking few buttons. In principle, the fix should be in 0.10 branch too, but your 0.10 patch level is 25, while the latest is at patch 40: https://nodejs.org/dist/latest-v0.10.x/.
Will "it work" after I update node.js?
No; you are trying to install package called node-gd which does not support Windows at this point.
It turned out the original repo is https://github.com/taggon/node-gd/ where the development is discontinued. Last Commit was on Aug 17, 2012.
However, there is a "community maintained" fork by @y-a-v-a, which installs with npm install node-gd, but as you can see here, there are some challenges in porting this package, which was originally designed for Unix systems only. One of the challenge I reckon is to enforce the presence of libgd and then locate it, which I imagine @y-a-v-a may want to build from source on installing the package on Windows (and can use same method if the package is missing on Unix). To be able to do that, the first step is to make sure libgd compiles with VS2015, which it doesn't at the moment (so I have opened a pull request https://github.com/libgd/libgd/pull/192, lets see..).
In other words, you can follow the progress on node-gd support at https://github.com/y-a-v-a/node-gd/ as your issue belongs to that specific package.
@luisrudge, thanks for the update. The whole community have got at least one achievement (build tools) by the virtue of this thread of yours. Unfortunately, the road to productivity is paved with people who just can't stop trolling..
@jasonwilliams200OK May I remind you that snarky or overly emotional responses on Github are generally looked down upon. Github is a place of collaboration. Not everyone is going to have the same background or information as yourself.
Being rude or negatively passive aggressive does not help a conversation and is rather poor sport as Github prides itself in being quite an exceptional community, devoid of insult or lashing out from those above others. Everyone here is here to learn and to grow, together, in a very raw (and yes, often times direct) fashion.
There is no need, and no place, for attitude.
I hope one such as yourself could appreciate this. Let's keep things civil and at the very least professional and respectful, okay? :+1: