nodejs / node-gyp

Node.js native addon build tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows users are not happy.

luisrudge opened this issue · 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

+1
Is there some common effort we can do?

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: npm i c3 still fails. Even with vs2015 installed. @TooTallNate any ideas?

c:\git\rr\MyProject\src (master)
? npm i -S c3
npm WARN package.json package@0.0.0 No description
npm WARN package.json package@0.0.0 No repository field.
npm WARN package.json package@0.0.0 No README data
npm WARN package.json package@0.0.0 No license field.
-


> contextify@0.1.14 install c:\git\rr\MyProject\src\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild

\
c:\git\rr\MyProject\src\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify {git}
{lamb} 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 (rebuild)
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 534, in script_main
    return main(sys.argv[1:])
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 527, in main
    return gyp_main(args)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 503, in gyp_main
    options.circular_check)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1867, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 402, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2015'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:343:16)
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"
cwd c:\git\rr\MyProject\src\node_modules\c3\node_modules\d3\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
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" "i" "-S" "c3"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     c:\git\rr\MyProject\src\npm-debug.log

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?

commented

+1000
More than two days working to figure out this gyp thing. The problem is I can't give up.

+100500!
Much pain with 'node-gyp'! 15 GB of Visual Studio versions/SP/tools downloaded...

For windows 7 I use VS 2010 and SDK 7.1 command prompt. This instruction can help:
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

With Windows 8.1 pro and VS 2013 Express and SDK 8.1 I'm still get this error:

  bufferutil.cc
..\src\bufferutil.cc(7): fatal error C1083: Не удается открыть файл включение:
v8.h: No such file or directory [C:\Users\Артем\AppData\Roaming\npm\node_module s\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_module s\engine.io-client\node_modules\ws\node_modules\bufferutil\build\bufferutil.vcx proj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\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:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Артем\AppData\Roaming\npm\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.1.0
npm WARN optional dep failed, continuing bufferutil@1.1.0

Now I'm downloading VS 2013 Community (#644)

Update.
VS2013 Community version not helps..#676 created

commented

@Sogl

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

Note: I had Visual Studio 2015

I hope this helps if not you can look @ socket.io / issues.

@Baazoo

Can't install with 2013/2010:

C:\Users\Артем>npm install -g socket.io --msvs_version=2013

> bufferutil@1.1.0 install C:\Users\Артем\AppData\Roaming\npm\node_modules\socke
t.io\node_modules\bufferutil
> node-gyp rebuild


C:\Users\Артем\AppData\Roaming\npm\node_modules\socket.io\node_modules\bufferuti
l>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-
gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  reb
uild )
Сборка проектов в этом решении по одному. Чтобы включить параллельную сборку, до
бавьте параметр "/m".
  bufferutil.cc
..\src\bufferutil.cc(7): fatal error C1083: Cannot open include file: 'v8.h': N
o such file or directory [C:\Users\Артем\AppData\Roaming\npm\node_modules\socke
t.io\node_modules\bufferutil\build\bufferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\nodejs\node_modules\npm\node_modul
es\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:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Артем\AppData\Roaming\npm\node_modules\socket.io\node_modu
les\bufferutil
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No description
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No repository field.
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No README data
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No license field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-
cli.js" "install" "-g" "socket.io" "--msvs_version=2013"
npm ERR! node v0.12.7
npm ERR! npm  v3.2.0
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Артем\npm-debug.log

C:\Users\Артем>npm install -g socket.io --msvs_version=2010

> bufferutil@1.1.0 install C:\Users\Артем\AppData\Roaming\npm\node_modules\socke
t.io\node_modules\bufferutil
> node-gyp rebuild


C:\Users\Артем\AppData\Roaming\npm\node_modules\socket.io\node_modules\bufferuti
l>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-
gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  reb
uild )
Сборка проектов в этом решении по одному. Чтобы включить параллельную сборку, до
бавьте параметр "/m".
  bufferutil.cc
..\src\bufferutil.cc(7): fatal error C1083: Cannot open include file: 'v8.h': N
o such file or directory [C:\Users\Артем\AppData\Roaming\npm\node_modules\socke
t.io\node_modules\bufferutil\build\bufferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\nodejs\node_modules\npm\node_modul
es\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:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Артем\AppData\Roaming\npm\node_modules\socket.io\node_modu
les\bufferutil
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No description
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No repository field.
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No README data
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No license field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-
cli.js" "install" "-g" "socket.io" "--msvs_version=2010"
npm ERR! node v0.12.7
npm ERR! npm  v3.2.0
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Артем\npm-debug.log

C:\Users\Артем>

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?

commented

@Sogl
I didn't follow from the beginning. Take a look at Updating npm's bundled node gyp if you already haven't.

Other solution would be to settle a non MSFT compiler and use one that is still available for the plateform.

@Baazoo

Didn't help.

@thoroc

Also found info about build with pangyp:

npm i pangyp -g
npm config set node-gyp pangyp

Also this tool works with io.js.
For me it doesn't work because my userprofile name in Russian.
But it still use MS compiler...

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.

commented

@Sogl
I just encounterd similar issue when trying to install gulp-devtools.

c:\users\hamed\.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 [C:\Users\h
amed\AppData\Roaming\npm\node_modules\gulp-devtools\node_modules\socket.io\node
_modules\socket.io-client\node_modules\ws\build\bufferutil.vcxproj]
  validation.cc
c:\users\hamed\.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 [C:\Users\h
amed\AppData\Roaming\npm\node_modules\gulp-devtools\node_modules\socket.io\node
_modules\socket.io-client\node_modules\ws\build\validation.vcxproj]

This is what worked for me:

  1. Switched terminal from Powershell to CMD (Powershell didn't work)
  2. set GYP_MSVS_VERSION=2015
  3. Installed the package in my case npm install -g gulp-devtools

There is one more suggestion!

@Baazoo
Just tried things you describe.
Same 'v8.h' error =(

One last step that I want to try - install VS 2015 😆

I also resorted to the workflow @thoroc described (using a VM inside Windows).

@thoroc
@b-long

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"

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?

@b-long can you elaborate on that? I'm sorry, but I'm a newbie :)

commented

I have VS 2015 community, the build tools and nothing seems to work.... I keep getting a NanThrowError. I have the VC++ distribution, have set the msvs version, nothing seems to work.

Any insight or suggestions are greatly appreciated.

C:\Users\dhook\AppData\Roaming\npm\node_modules\odbc>if not defined npm_config_n
ode_gyp (node "H:\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\n
ode-gyp\bin\node-gyp.js" configure build ) else (node configure build )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
odbc.cpp
odbc_connection.cpp
odbc_statement.cpp
odbc_result.cpp
dynodbc.cpp
..\src\odbc_connection.cpp(436): error C2668: 'NanThrowError': ambiguous call t
o overloaded function [C:\Users\dhook\AppData\Roaming\npm\node_modules\odbc\bui
ld\odbc_bindings.vcxproj]
C:\Users\dhook\AppData\Roaming\npm\node_modules\odbc\node_modules\nan\nan.h(7
19): note: could be 'void NanThrowError(v8::Handlev8::Value)' (compiling so
urce file ..\src\odbc_connection.cpp)
C:\Users\dhook\AppData\Roaming\npm\node_modules\odbc\node_modules\nan\nan.h(7
11): note: or 'void NanThrowError(v8::Handlev8::String)' (compiling s
ource file ..\src\odbc_connection.cpp)
C:\Users\dhook\AppData\Roaming\npm\node_modules\odbc\node_modules\nan\nan.h(7
11): note: or 'void NanThrowError(const char *)' (compiling source file
..\src\odbc_connection.cpp)

@luisrudge Sorry, I'm a bit of a compiler newbie myself. Maybe @TooTallNate or someone else at Joyent ( @trevnorris ?) can comment. I'm fairly certain node-gyp on Windows is a pain point for many developers and as such, I'll do development / testing in a VM or remote server when I'm on Windows.

There's this discussion on StackOverflow, but IMHO we can do better than a variety of "try this..." or "maybe that?". Personally, I'd suggest my workflow (get yourself cygwin and ssh to something else). Otherwise, wait until Microsoft does something about this (they say they support the development of NodeJS) or until NodeJS core team addresses it.

Lastly, I'm also pretty sure this isn't @TooTallNate's fault 😄 . As far as I can tell, he was filling a gap that needed to be filled. This is the 85% solution and many people owe Nate thanks for it, but now the community needs to push the effort even further.

I'm sure it isn't @TooTallNate's fault. This issue was never intended to point a finger to anyone. With that being said, this workflow NEEDS to get better, hence the issue. How can Microsoft fix this? What needs to be done to fix this? Knowing this, we can move this discussion forward with MSFT people.

Oh no, I know you didn't think it's Nate's fault :) I just didn't want Nate to think, that I think, that it's his fault. I guess a better solution would be a script-able (or npm install-able) compiler, with proper settings, etc. as defaults.

That doesn't need to come from Microsoft, but it has to work on Windows and they know Windows better than anyone. Maybe some of the folks working on https://github.com/Microsoft/nodejstools or https://github.com/Azure/azure-sdk-for-node would know someone or know something about solving this?

@mousetraps @paulvanbrenk would you mind taking a look on this thread? :) Thanks!

IMO we might as well wave a dead chicken as expect a proper solution from MS. There are so many forces pulling in different directions in a company that size, and I doubt they would be able to steer things in the right direction just to help the node community even if they wanted to. (No offence intended to the MS people linked above. And I'd love to be proven wrong).

Is there a viable route we could take that didn't rely on MS compilers (or VMs)? (Perhaps that is a stupid question - I really don't know)

commented

I intsalled nodejstools in VS 2015 and doing the compile in VS2015, I get the same errors ......

@donaldhook If an error occurs with node-gyp when you're installing https://github.com/Microsoft/nodejstools , perhaps writing an issue there would spur someone from MS to investigate ?

commented

Will do ...

@luisrudge thx for the tag - agreed it's super frustrating... I'll start reaching out to people today - we'll see what we can do on our end to help improve the experience.

@bgSosh challenge accepted 😃

challenge accepted

Nice! Good luck @mousetraps :)

After installing MSVS 2015, node-gyp builds failed, so I uninstalled 2015, and ran a "repair" install over my existing 2010 installation. This fixed the failing node-gyp builds for me.

Hopefully this helps someone.

@mousetraps thank you very much! Please keep us posted :)

Dug into this a bit today, and have some (heavily caveated) good news.

VS isn't necessarily required - we didn't really publicize this much, but Microsoft released the C++ compiler pkg targeting Python 2.7 a while ago, and you should be able to replace the download-VS step with the following download:
http://aka.ms/vcpython27

More details here. The caveat is that there is no official support, it wasn't verified for use with node, etc - so don't expect bug fixes or improvements. But if it happens to work fine for you, then great 😃

AFAIK... that combined w/ python 2.7 & the Windows SDK should be sufficient, but someone else should probably verify. It worked fine with the few pkgs I tried to install.

Hope that helps, and let us know if you have any ideas of how we can further improve the Windows experience. The more concrete/actionable, the better.

EDIT
Here is the link to the windows sdk I used - I've only tried Win 7 - I haven't tried Win8 or Win10 yet.

[PLEASE READ] And just to be crystal clear on this... I am not even close to being an expert in this space, and there are absolutely no guarantees whatsoever. It just happened to work for me for the pkgs I was trying to install, so hopefully it works for others too.

This compiler package is entirely unsupported and represents a snapshot of the last version that is fully compatible with Python 2.7. For the latest security and bug fixes, please use the latest version of Microsoft Visual Studio for any development work that does not directly interface with Python 2.7.

so, we have to install python, Microsoft Visual C++ Compiler for Python 2.7 and the windows sdk? do you have a link for the win sdk?

@luisrudge updated my comment above so it's all in one place. And also made the disclaimer much more clear 😃

commented

I installed the VC++ Python compiler to no avail ....Windows SDK 7.1 does not install due to the detection of a pre-release version of .NET 4... which, I have a 4.6 GA release ... Hopefully I can get that installed to see if that will help with the node-gyp compile issue

@donaldhook ah, gotcha. FWIW I just tried the pkg you were trying to install (odbc), and received the same errors - not entirely sure what the issue is or whether it's an issue w/ the pkg or node-gyp itself, so don't spend too much time on it... Do other pkgs work for you? like socket.io?

(for future reference, Node Tools is no longer on codeplex, so pls don't file issues there - everything is on github now https://github.com/microsoft/nodejstools)

commented

Sara, socket.io does install, with some warnings as seen below ... Thanks
...

C:\Users\dhook\AppData\Roaming\npm\node_modules\socket.io\node_modules
engine.io
\node_modules\ws\node_modules\utf-8-validate>if not defined
npm_config_node_gyp
(node
"H:\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.
validation.cc
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 http://socket.io\node_modules\engine.io
http://engine.io\node_modules\ws\node_mo

dules\utf-8-validate\build\validation.vcxproj]
Creating library C:\Users\dhook\AppData\Roaming\npm\node_modules
socket.io
\node_modules\engine.io
\node_modules\ws\node_modules\utf-8-validate\build\Rel
ease\validation.lib and object
C:\Users\dhook\AppData\Roaming\npm\node_module
s\socket.io\node_modules\engine.io
\node_modules\ws\node_modules\utf-8-validat
e\build\Release\validation.exp
Generating code
Finished generating code

On Thu, Aug 6, 2015 at 7:01 PM, Sara Itani notifications@github.com wrote:

@donaldhook https://github.com/donaldhook ah, gotcha. FWIW I just tried
the pkg you were trying to install (odbc), and received the same errors -
not entirely sure what the issue is or whether it's an issue w/ the pkg or
node-gyp itself, so don't spend too much time on it... Do other pkgs work
for you? like socket.io?

(for future reference, Node Tools is no longer on codeplex, so pls don't
file issues there - everything is on github now
https://github.com/microsoft/nodejstools)


Reply to this email directly or view it on GitHub
#629 (comment)
.

@mousetraps, Still the same error after installing vc++ for python 2.7 compiler:

$ npm i -g browser-sync
npm WARN install Couldn't install optional dependency: Unsupported
C:\Users\Артем\AppData\Roaming\npm\browser-sync -> C:\Users\Артем\AppData\Roaming\npm\node_modules\browser-sync\bin\browser-sync.js

> bufferutil@1.1.0 install C:\Users\Артем\AppData\Roaming\npm\node_modules\browser-sync\node_modules\bufferutil
> node-gyp rebuild


Артем@SOGL C:\Users\Артем\AppData\Roaming\npm\node_modules\browser-sync\node_modules\bufferutil
$ if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Сборка проектов в этом решении по одному. Чтобы включить параллельную сборку, добавьте параметр "/m".
  bufferutil.cc
..\src\bufferutil.cc(7): fatal error C1083: Cannot open include file: 'v8.h': N o such file or directory [C:\Users\Артем\AppData\Roaming\npm\node_modules\brows er-sync\node_modules\bufferutil\build\bufferutil.vcxproj]
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:\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:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Артем\AppData\Roaming\npm\node_modules\browser-sync\node_modules\bufferutil
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No description
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No repository field.
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No README data
npm WARN EPACKAGEJSON C:\Users\Артем\AppData\Roaming\npm No license field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "browser-sync"
npm ERR! node v0.12.7
npm ERR! npm  v3.2.0
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Артем\npm-debug.log

Same error with socket.io installation.
My env here: #676

@mousetraps , Just tried to fresh VM Windows 8.1 pro x64 installation.
Node.js v 0.12.7, python 2.7.9, npm 3.2.0, VC compiler for python 2.7 only
Got this error:

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".

Same after SDK 8.1 full installation.

@Sogl In my earlier comment, I was recommending a Linux VM. Just to clarify :) Good luck!

@b-long , I already use Linux VM... but I'm curious to get node-gyp work on Windows =)) I solved this problem on Windows 7, but 8 isn't giving up.

@Sogl Ah, I see. Sorry about that.

Just did it on fresh Windows 8.1 without installing any VS!!! ⭐

Installed:

  • Node.js v 0.12.7
  • npm 3.2.0
  • Python 2.7.9
  • VC++ compiler for python 2.7
  • MS build tools 2013
  • SDK for Windows 8.1
  • SDK for Windows 7 with SP1

Finally go to Start -> All Programs -> Microsoft Windows SDK v7.1 -> Windows SDK 7.1 Command Prompt
No need to set PATH, msvs_version and other "magic" things...

Packages browser-sync and socket.io installed successfully. Snapshot created.

Now I want to find a minimum set of libraries which make it works.

commented

Great...

On Wed, Aug 12, 2015 at 9:38 AM, Artyom Mezin notifications@github.com
wrote:

Just did it on fresh Windows 8.1 without installing any VS!!! [image:
⭐]

Installed:

  • Node.js v 0.12.7
  • npm 3.2.0
  • Python 2.7.9
  • VC++ compiler for python 2.7
  • MS build tools 2013
  • SDK for Windows 8.1
  • SDK for Windows 7 with SP1

Finally go to Start -> All Programs -> Microsoft Windows SDK v7.1 ->
Windows SDK 7.1 Command Prompt

Packages browser-sync and socket.io installed successfully. Snapshot
created.

Now I want to find a minimum set of libraries.


Reply to this email directly or view it on GitHub
#629 (comment)
.

You need only these things to fix problem with node-gyp on Windows 8.1:

  • Node.js v 0.12.7
  • npm 3.2.0
  • Python 2.7.9
  • SDK for Windows 7 with SP1

Install tools with Windows SDK 7.1 Command Prompt.

All VM programs:
packages

p.s. I tried this on Windows 10, but I can't install SDK 7.1 compiler because:
ev644afv-og
And all .net 4/4.5 etc installators say that I already have .net newer version installed =(

Also if I use C++ compiler for python command prompt:

vcbuild.exe : error VCBLD0010: Project 'C:\nodejs\node_modules\browser-sync\nod
e_modules\bufferutil\build\bufferutil.vcproj' requires upgrade. Use 'vcbuild /u
pgrade' or 'devenv /upgrade' to upgrade the project. [C:\nodejs\node_modules\br
owser-sync\node_modules\bufferutil\build\binding.sln]

and with --msvs_version=2008:

c:\users\)\.node-gyp\0.12.7\deps\v8\include\v8stdint.h(10): fatal error C1083: Cannot open
include file: 'stddef.h': No such file or directory [C:\nodejs\node_modules\browser-sync\
node_modules\bufferutil\build\binding.sln]

Those who are struggling with making it work with VS 2015 don't forget to make sure you've installed the C++ part of VS 2015. It's not installed by default.
image

commented

I had installed that as part of the VS2015 and had issues ... so make sure
you have the other items installed....

On Thu, Aug 13, 2015 at 7:48 AM, thorn0 notifications@github.com wrote:

Those who are struggling with making it work with VS 2015 don't forget to
make sure you've installed the C++ part of VS 2015.
[image: image]
https://cloud.githubusercontent.com/assets/94334/9250024/a3ca627a-41d2-11e5-8efb-1417d686eaa4.png


Reply to this email directly or view it on GitHub
#629 (comment)
.

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

commented

Had errors there too ....

On Thu, Aug 13, 2015 at 8:32 AM, thorn0 notifications@github.com 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
#629 (comment)
.

What did these errors say?

commented

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 notifications@github.com wrote:

What did these errors say?


Reply to this email directly or view it on GitHub
#629 (comment)
.

@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:
#629 (comment)

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 , 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:
#297

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
|
> bcrypt@0.8.5 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! bcrypt@0.8.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.5 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 Do you actually have winsock2.h anywhere in Program files or Program files (x86)?

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

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

@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

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

So you have the SDK.

Seems so...

commented

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 notifications@github.com
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
#629 (comment).

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 I ticked what you said here but on. #629 (comment)

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

My npm version is 2.11.3

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

Couldn't manage to change my user folder since I have the Home version. Anyway it shouldn't matter since it's running from Program Files and not users. I managed to update npm and still I get the same errors.
I find this issue absolutely ridiculous: I'm just trying to add a package (addict) to an Elixir/Phoenix Framework project, but that package has a dependency on another package (comeonin) which in turn points to a dependency compilation error in bcrypt wich in turn points to its dependency on node-gyp giving this error.

Couldn't manage to change my user folder since I have the Home version.

In Home you can't put your computer into Domain, can't use group policy management and some other small things... I can't see problem with profile.
0

Six steps that I did:

  1. Add +1 admin account
  2. Login with this new account in Safe Mode
  3. Open regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  4. Change selected key with old user name to new (edited by @addaleax: There was a screenshot here before which has since been replaced by an advertisement for a potentially harmful site, so I’ve removed it – see #1063)
  1. Rename your C:\Users\old profile to C:\Users\new.
  2. Reboot and log-in to your account. Now you can delete useless admin account.

Some more info here:
(edited by @addaleax: Removed link here too, for the same reason)

Anyway it shouldn't matter since it's running from Program Files and not users.

Nope. Npm uses appdata folder because it's a global module but running from program files. Also you can see that from your console output:

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]

Steps to update npm on Windows:

  1. cmd
  2. npm i -g npm@3.2.0 (global update)
  3. cd "C:\Program Files\nodejs" and npm i npm@3.2.0
  4. npm -v (must be 3.2.0)

More info:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

Managed to do what I wanted with a symlink created.

@mesosteros, Can you describe what you have done?

@Sogl I did it like so:

Run Command Prompt (as administrator):
cd C:\Users
mklink /d mesos mesos_000

Then run the Developer Command Prompt installed with Visual Studio 2015 (from the start menu -> applications), also as administrator, going to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\

and running the command vcvarsall.bat amd64

Finally, I created a completely new phoenix project in my elixir projects folder, added

{:addict, ">= 0.1.0"}

Then the part where I was getting the error:

mix deps.get
mix deps.compile comeonin

and pronto.

Windows 7, Visual Studio 2013 Professional, python 2.7.3, tried doing

npm install kafka-node

Both it failed gloriously, all coming down to this one

npm install snappy

Went through a ton of instructions on how to set things up, got the Windows SDK 7.1, the Microsoft Build Tools 2013 and thing seem to progress well, then I finally get this error:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(507,5): error MSB8008: Specified platform toolset (v120) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [D:\sample\node_modules\snappy\build\deps\snappy\snappy.vcxproj]

For the life of me I can't get past this, check a couple things on the internet, and still can't find a way to get around it, even though node-gyp and pangyp say they support VS2013 on Windows 7

I ended up finding this page: https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

Went through the additional steps, setting msvs_version to 2010 and installing VS2010 + SP1

Voila, everything installs.

I need to make instructions for the rest of my development team to set this up, and having them install Windows SDK (seems unavoidable), VS2010 (seems avoidable) and setting up an msvs_version seems like a whole heck of a lot more per-user setup than should be neccesary

my current setup is this:

  • Install visual studio with the visual c++ option enabled
  • install python2
  • setx GYP_MSVS_VERSION 2015 (i'm using visual studio 2015)

after that, everything runs just fine.

@mesosteros, Good! I'll try it today on my VM.

@dekarguy, v120 = vs 2012
Did you try to specify vs 2013 version with --msvs_version=2013? I didn't install vs 2010 in my last configuration.

@Sogl Definitely tried with --msvs_version=2013, v120 is actually 2013, really confusing and annoying

@luisrudge setx GYP_MSVS_VERSION 2013 didn't help

it's GYP_MSVS_VERSION

fixed my typo and no dice

:( Did you install the visual c++ thing?

On my Windows 7 x64, node-gyp works fine with VS2015 without setting GYP_MSVS_VERSION. If we summarize what's been written in this issue about VS2015, we'll get only two important points to check:

  • The C++ part of the VS was installed. By default, it isn't.
  • The user profile folder is named only in English letters. No other languages, no characters like underscore (_) etc.

@luisrudge Are you sure GYP_MSVS_VERSION is really required? Doesn't it work for you without it? What's your OS?

win 8.1 x64
installed Python compiler
installed npm 3.2
installed Visual Studio Express 2105
installed Windows 7 SDK
added user with latin-only name

it compiles!
Run cmd NOT as admin (user with latin-only name in dir path)
cmd:
SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140 - some problems with my PATH
set GYP_MSVS_VERSION 2015
npm install

and it's done! (problem was with compiling bcrypt)
Thanks a lot for all advises! Hope my info will be useful

@ProtomotoReal Thank you!!!

I was able to run a normal cmd window (not the Windows SDK 7.1 prompt)
SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120

I didn't need to set the GYP_MSVS_VERSION, nor the npm config msvs_version variable

It looks like for my team to get set up on Windows 7 + Visual Studio 2013 that the steps will be

Install Python 2.7
npm set python C:\Python27\python.exe --global
Install Windows 7 SDK
SET VCTargetsPath=C:\Program Files (x86)\MSBUILD\Microsoft.Cpp\v4.0\V120 npm install

Thank you all for the help, I think we can all agree that making this easier would be grand

Hi, i had the same problems with npm-gyp. Initially i got a build problem and i solved it following the suggestions in this thread. I have:

Windows 7 x64 Ultimate
VS 2012
VS 2013
VS 2015
Python 2.7.6
NPM 2.13.3
NODE 0.12.7
Microsoft Windows SDK 7.1

but during the npm install exit with only an error on parsing package.json:


R:\Progetti\Nodejs\relay>npm install
npm WARN peerDependencies The peer dependency babel-core@* included from babel-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
-
> utf-8-validate@1.1.0 install R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engi
ne.io-client\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild

-
R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\no
de_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Users\Piero\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bi
n\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Compilazione dei progetti nella soluzione uno alla volta. Per abilitare la compilazione parallela, aggiungere l'opzione "/m".
  validation.cc
     Creating library R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-cl
  ient\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.lib and object R:\Progetti\Nodejs\relay\node_modules\webpa
  ck-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate\build\Release\
  validation.exp
  Generating code
  Finished generating code
  validation.vcxproj -> R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-
  client\node_modules\ws\node_modules\utf-8-validate\build\Release\\validation.node

> bufferutil@1.1.0 install R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.i
o-client\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild


R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\no
de_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\Piero\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\.
.\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Compilazione dei progetti nella soluzione uno alla volta. Per abilitare la compilazione parallela, aggiungere l'opzione "/m".
  bufferutil.cc
     Creating library R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-cl
  ient\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.lib and object R:\Progetti\Nodejs\relay\node_modules\webpack-d
  ev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\build\Release\bufferut
  il.exp
  Generating code
  Finished generating code
  bufferutil.vcxproj -> R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-
  client\node_modules\ws\node_modules\bufferutil\build\Release\\bufferutil.node
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\Users\\Piero\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.3
npm ERR! file C:\Users\Piero\AppData\Roaming\npm-cache\qs\4.0.0\package\package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\Piero\AppData\Roaming\npm-cache\qs\4.0.0\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! Please include the following file with any support request:
npm ERR!     R:\Progetti\Nodejs\relay\npm-debug.log

it seems the soccket.io-client gives problems. I set the msvs_version to 2013.

@pierol, Your node-gyp works fine.

I think this can help:
http://stackoverflow.com/questions/17944345/npm-install-cannot-read-package-json

@dekarguy, You can also check my configuration that not need VS:
#629 (comment)

Now I'm fighting with VCTargetsPath that can add normal cmd working.

@Sogl i solved thank you the reason was corrupted packages.json files on disk.

ProtomotoReal, many thanx! Finally got it going after a whole weekend of wanting to throw my laptop out the window!

This helped fixing my issues: #629 (comment)