-
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 users are not happy. #629
Comments
+1 The reliance on both Visual Studio (or the Windows SDK) and Python is such a pain. And when it still doesn't work 99.9/100 times anyway, while node-gyp still being so heavily used by the Node community, it's enough to make a grown man cry or give up on using whatever it was that relied on node-gyp. |
+1 this a world of pain, took me hours to install a project with node_gyp |
+1 after 8+ hours of trying, still can't use anything that relies on node-gyp. |
👍 after multiple days trying to get this to install I am still fighting VS errors!! It just never gives up. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript. |
@TooTallNate any thoughts? |
node-gyp v2.0.0 (just released) has an updated gyp version that adds support for MSVS 2015, and should hopefully ease of lot of this pain for Windows users. |
Additionally, you guys should probably support my current effort in bringing FFI into node core, thus eliminating node-gyp from the equation for the majority of use-cases. |
Awesome @TooTallNate. I don't have the skills to understand and support your argument, but I can give you a 👍 haha :( Congratz on the new release, but I believe we have to wait for everyone to update the dependency version and that maybe never happens. |
I'm also struggling with this quite a bit. I'm trying to follow along with this guide (https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup), but I'm not having much luck. The guide in the wiki directs us to http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express, which redirects to https://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express and that page does not offer VS 2010 for download (it's exclusively 2013). Even more hilarious / sad, in attempting the uninstall procedures, I somehow wound up with "Microsoft Visual Studio 2010 Service Pack 1" listed in my Programs and Features (Uninstall menu), but when I click "Uninstall/Change", I'm given an error after a while that says "A compatible version of Visual Studio 2010 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2010." |
Yeah. There needs to be a better way |
@TooTallNate I'm pretty sure you're doing the best work there is for Node support on Windows 👍 :) Could I make a request that we update the wiki page (or add a new wiki page) describing the steps for VS 2015 ? |
FYI: |
|
I just found out about the environment variable (GYP_MSVS_VERSION ) option here: #339 (comment) , it might help @luisrudge or others. Any other updated happy paths for Windows users? /cc @TooTallNate @isaacs |
+1 This is a real pain point - I'm spending as much time fiddling around with VS and node-gyp as I am coding at the moment. IMO the core of the problem is all these MS/VS dependencies, which are a total mess - is there any way we could circumvent these? |
+1000 |
+100500! For windows 7 I use VS 2010 and SDK 7.1 command prompt. This instruction can help: With Windows 8.1 pro and VS 2013 Express and SDK 8.1 I'm still get this error:
Now I'm downloading VS 2013 Community (#644) Update. |
I installed socket.io with MSVS version set and then installed the rest of the stuff: npm install socket.io --msvs_version=2015
npm install
I hope this helps if not you can look @ socket.io / issues. |
Can't install with 2013/2010:
|
The root of this issue is that Microsoft's willingness to provide a c/c++ compiler on Windows is lackluster. Right? Is there not some other approach (e.g. using a Cygwin DLL or something from MinGW ) that might suffice? |
@Sogl |
Other solution would be to settle a non MSFT compiler and use one that is still available for the plateform. |
Well I am resorting to install a VM with Ubuntu on it for dev. But I am not really happy to have to change OS just because node-gyp is forcing me into installing MSFT dev tooling. From I have read changing to an FOSS C++ compiler would mean a major refactoring of the tool itself. Which incidently and understandly, no one wants to undertake. |
@Sogl
This is what worked for me:
There is one more suggestion! |
@Baazoo One last step that I want to try - install VS 2015 😆 |
I also resorted to the workflow @thoroc described (using a VM inside Windows). |
Yep, guys. This problem also has led me to use Vagrant (with VirtualBox) and Scotch Box. |
Sorry. The solution can't be "use a vm instead" |
@jasonwilliams200OK, yes, but file from patch you referred is |
@galeksandrp, the patch I linked is highlighting the portion of gypi fix which anyone can apply locally. You missed the point, which was this particular issue (among dozens of others discussed in this thread) can be fixed in gyp. To your meticulous concern, in node-gyp crossplatform buildsystem scenario, modify 'include_dirs': [
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/um',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/shared',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/winrt'
], This will make the node.js package with C++ add-on compile with Windows 10 SDK, without having to install Windows 8 SDK. |
For those still having node-gyp issues, please try the following: Step 1Make sure you have the latest version of Node. Right now it is Step 2Use Mousetrap's solution, found here. You don't even need to read her full post, just blindly follow steps 1-4 that she provides. Step 2If you're getting an error I have tried this setup on three different OSes (Windows 7, Windows 8.1, Windows 10) and it always works. You don't need Visual Studio, just the As an additional note: I always run |
Confirming that @mousetraps method still works as of the time of writing with no additional steps.
Notes:
|
According to @fskreuz if you had this set during your struggle, make sure its updated to the most recent version |
@barocsi, note that if you have latest msbuild in PATH, then you do not need to set
In fact, you should rather unset it if it is set as process, user or machine env variable; because if you have multiple VS versions installed, fixing this environment variable to a version will led to other kinds of build errors. VCTargetsPath is usually set in |
Then it might have only worked for my particular bad chain of setups. Will clean up again, thanks. |
Where did @mousetraps comment go? It contained the full step by step guide but it looks like it has been deleted. Edit: My bad, a low connectivity prevented my browser from showing the comment as @jasonwilliams200OK mentioned. |
@Ucodia, that comment is still there. The page size is crazy long though, probably that's why browser must be acting funny. I vouch to open a part two of this issue for persistently unhappy users. 😄 |
Having done the following steps still does not work:
finally getting this error:
Sorry for spamming more, but is this a node-gyp? |
Definitely still not able to build things here without Visual Studio proper. Installed:
Test: npm install node-sass
cd node_modules\node-sass
del vendor\win32-x64-47\binding.node
node scripts\build.js
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
Build FAILED.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.20
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\mike\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mike\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\mike\node_modules\node-sass
gyp ERR! node -v v5.11.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Build failed |
So, do we still need to download and install the entire Visual Studio package just to install a couple native node modules that require node-gyp? Seems kind of excessive to me, the VS package is insanely large, takes a bit to install and also installs tons of MYSQL useless packages that you need to uninstall AFTER. Please tell me there is a solution to this. (Obviously, running it on Linux it only needs gcc and some other deps, which is fine) -- but I dev on Windows :( Also, where the fuck is Ryan Dahl? He should be working on node still. Where did he go? Edit2: Also why hasn't Github implemented pagination on issue pages? What a mess. |
@Dillybob92 no. You just need to download the msbuild tools: #629 (comment) |
@Dillybob92 BTW, your tone doesn't help anyone. |
@luisrudge My tone? This has been a problem for years and for Ryan Dahl to leave node and leave a mess for the community is a disgrace. Also, mousetraps post is not really a solution. That's still around 8 Gigabytes of SDK's. I'd rather just install VS 2013 express.. Also, those SDK's installers don't offer a custom installation folder. This is still a major issue that no one seems to address so my tone will stay the same. |
@Dillybob92 I understand it's not ideal, but it is what it is. |
* 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]>
Fixed with 0880827 |
One more note on this thread: the Visual C++ Build Tools are located here: http://landinghub.visualstudio.com/visual-cpp-build-tools |
@AndrewPardoe thanks for sharing the link. On that same page, it is mentioned that there is also a NuGet feed available for VC++ latest build tools, which we can incorporate in our node.js build process for targets where there C++ compiler is missing, using nuget.exe (the executable is # download nuget
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile nuget.exe
# install VC build tools
./nuget install VisualCppTools -source http://vcppdogfooding.azurewebsites.net/nuget/ -Prerelease Although this is one huge download, but still might come handy for someone to unblock their users from not getting the npm packages installed at all, and automate the build process for them. |
Success installing npm bcrypt module on windows 10
System 1 (desktop) System 2 (laptop) The steps I will detail here, as well as the output, are those from system 1 (but the steps were the same on system 2). STEP 1 STEP 2 STEP 3 STEP 4 This is the output I got (********** asterisks are simply used to hide my local project folder path):
I am now able to run
I have no way of knowing if these hashes are perfect bcrypt hashes be they look good to me. I would appreciate any input regarding the importance of the warnings referenced in the output above. Thanks to all who contributed to this thread :) |
This issue was addressed with the release of the VC++ Build Tools, and an updated list of instructions for Windows developers both in the node-gyp README and in the new https://github.com/Microsoft/nodejs-guidelines repo. For any further problems, bug reports, suggestions, etc. related to installing/compiling native modules, please open a new issue in this repo, or at https://github.com/nodejs/node, or - if the issue is pertinent to a specific module and not to node/nodegyp in general - in the module's own issue tracker. I believe those avenues will be more productive than continuing to comment on this giant thread, so I am locking it now. Thanks again to everybody who contributed to the discussion and resolution! 😄 |
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
The text was updated successfully, but these errors were encountered: