node-gyp icon indicating copy to clipboard operation
node-gyp copied to clipboard

Windows users are not happy.

Open luisrudge opened this issue 11 years ago • 474 comments

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

luisrudge avatar May 22 '15 03:05 luisrudge

Had errors there too ....

On Thu, Aug 13, 2015 at 8:32 AM, thorn0 [email protected] wrote:

@donaldhook https://github.com/donaldhook Do you get the errors only when installing odbc? What about other packages (e.g. socket.io)?

— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130672896 .

donaldhook avatar Aug 13 '15 13:08 donaldhook

What did these errors say?

thorn0 avatar Aug 13 '15 13:08 thorn0

My mistake. I tried installing when I was having the ODBC issue. The errors I receive are WARNINGS... So sorry for confusing anyone or making more work.

I had posted on the ODBC board to work through the issues. I have found a work around for the time being using the JDBC npm package.

Thanks to all of you working on the issue!

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termi nation on exception is not guaranteed. Specify /EHsc [C:\Users\dhook\AppData\Ro aming\npm\node_modules\socket.io \node_modules\socket.io-client\node_modules\eng ine.io-client\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxp roj]

On Thu, Aug 13, 2015 at 8:38 AM, thorn0 [email protected] wrote:

What did these errors say?

— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130675383 .

donaldhook avatar Aug 13 '15 13:08 donaldhook

@mousetraps, Can you help me with this? I found a workaround without VS or VC++ compiler for Python, but it not works on clean Windows 10 and often not work on not clean WIndows 8.1 because I can't install SDK 7.1.

See my previous message: https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130513913

Sogl avatar Aug 14 '15 11:08 Sogl

Important info!!11 If your Windows profile folder name has non-english chars (my had russian) - change it! Like this Because there is path "C:\Users___\AppData\Roaming\npm" in %PATH%, where v8.h and other headers located.

ukrbublik avatar Aug 15 '15 15:08 ukrbublik

@ukrbublik , You right! Just tried with russian username in Windows 8 and got the same v8.h error, but with eng. username compilation done well.

Now my node-gyp works as expected.

What I did:

  • I renamed my profile folder with ACSII characters only
  • VS 2013 Community installed
  • npm config set msvs_version 2013 in console

I think the problem is related with this: https://github.com/TooTallNate/node-gyp/issues/297

Sogl avatar Aug 16 '15 07:08 Sogl

Doens't work for me. Install VC2015 (Windows 10 x64 bits) and when I try to install bcrypt, it still gets me the node-gyp errors:

C:\Users\mesos_000\Desktop\elixir Projects\testingBlog>npm install -g bcrypt
|
> [email protected] install C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt
> node-gyp rebuild


C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node
_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  blowfish.cc
  bcrypt.cc
  bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=' : conversion from 'size_t' to 'unsigned char', possible loss of data [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcryp
t\build\bcrypt_lib.vcxproj]
c:\users\mesos_000\.node-gyp\0.12.7\deps\uv\include\uv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory (..\src\bcrypt_nod
e.cc) [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bcrypt"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\mesos_000\Desktop\elixir Projects\testingBlog\npm-debug.log

mesosteros avatar Aug 18 '15 14:08 mesosteros

@mesosteros Do you actually have winsock2.h anywhere in Program files or Program files (x86)?

thorn0 avatar Aug 18 '15 15:08 thorn0

@thorn0 no. Don't even know what that is. I'm gonna install the Windows 7 SDK (I think it'll work on 10)

mesosteros avatar Aug 18 '15 15:08 mesosteros

It's a part of the Windows SDK. Just to confirm, did you perform a recursive search for this file in those folders?

thorn0 avatar Aug 18 '15 15:08 thorn0

@thorn0 no. But the sdk isn't installing. I'm trying MicrosoftFixit to correct the installation. In the meantime I'm performing the search for winsock2.h

mesosteros avatar Aug 18 '15 15:08 mesosteros

@thorn0 Ok it seems I have winsock2.h on my Program Files (x86) at the Windows Kit and Windows Phone Kits folders

mesosteros avatar Aug 18 '15 15:08 mesosteros

So you have the SDK.

thorn0 avatar Aug 18 '15 15:08 thorn0

Seems so...

mesosteros avatar Aug 18 '15 15:08 mesosteros

I had issues installing the SDK as well, it wouldnt allow me to install it.

On Tue, Aug 18, 2015 at 10:30 AM, Carlos Santos [email protected] wrote:

@thorn0 https://github.com/thorn0 no. But the sdk isn't installing. I'm trying MicrosoftFixit to correct the installation. In the meantime I'm performing the search for winsock2.h

— Reply to this email directly or view it on GitHub https://github.com/nodejs/node-gyp/issues/629#issuecomment-132251191.

donaldhook avatar Aug 18 '15 15:08 donaldhook

It might be that node-gyp requires just the Windows 7 SDK. It's installed if you tick off Windows XP Support for C++ in the VS setup. Did you tick it off?

thorn0 avatar Aug 18 '15 15:08 thorn0

@thorn0 I ticked what you said here but on. https://github.com/nodejs/node-gyp/issues/629#issuecomment-130657536

mesosteros avatar Aug 18 '15 15:08 mesosteros

@mesosteros, I spent about month with C1083 error to resolve it. It was profile name bug =(

What npm version and Windows version you have? Did you try to rename your profile folder from mesos_000 to mesos? You can just create another profile in Windows. Also try to clear .node-gyp folder before build. Did you try to build from SDK 7.1 command prompt? All prompts must be Run as Administrator. Try to build with --msvs_version=2015.

Sogl avatar Aug 18 '15 23:08 Sogl

@Sogl My npm version is 2.11.3 and I'm using Windows 10 Home x64 bit. My prompts are being run as administrator and I've also tried the Developer Command Prompt. I'll try changing profile name.

mesosteros avatar Aug 19 '15 08:08 mesosteros

My npm version is 2.11.3

I recommend 3.x. Some Windows long path bugs has been fixed and more.

Sogl avatar Aug 19 '15 09:08 Sogl