¿Cómo hago que node-gyp funcione en la plataforma Windows 7?

Mis intentos de usar node-gyp en una plataforma Windows 7 + Node.js han fallado [3] al intentar compilar el ejemplo estándar de "Hello World" [2]. Nota: node-gyp está fallando de manera similar [3] al intentarnpm install contextify w o w / o la "-g", por lo tanto, estos podrían ser problemas relacionados.

Configuración:

node-gyp 0.12.2Windows 7 x64 SP1Python 2.7Node.js 0.10.24Visual Studio 2010 por [1] (también probado en 2012)VS SDK 7.1 por [1] (versiones de 32 y 64 bits probadas)ejecutando node-gyp desde el símbolo del sistema estándar de Windows o SDK7.1 cmd

Refs:
[1]https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup

[2]https://github.com/joyent/node/tree/master/test/addons/hello-world

[3] El proyecto "node-gyp reconstruction" en el proyecto "hello world" [2] produce los siguientes 2 errores:

.... node-gyp \ 0.10.24 \ deps \ uv \ include \ win.h (8738): error C2371: 'SYSTEM_POWER_STATUS': redefinición; diferentes tipos básicos [... \ build \ test.vcxproj]

.... node-gyp \ 0.10.24 \ deps \ uv \ include \ mswsock.h (27): error fatal C 1083: No se puede abrir el archivo de inclusión: '_mingw.h': no ​​existe tal archivo o directorio [... \ build \ test.vcxproj]

y siguiendo 2 advertencias:

.... node-gyp \ 0.10.24 \ deps \ uv \ include \ win.h (13513): advertencia C4005: 'UNALIGNED': redefinición de macro [... \ build \ test.vcxproj]

.... node-gyp \ 0.10.24 \ deps \ uv \ include \ mswsock.h (26): advertencia C4068: pragma desconocido [... \ build \ test.vcxproj]

La traza completa sigue:

C:\sigma\node_modules\x>node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\Anybody\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\sigma\\node_modules\\x\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Anybody\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Anybody\\.node-gyp\\0.10.24\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Anybody\\.node-gyp\\0.10.24',
gyp info spawn args   '-Dmodule_root_dir=C:\\sigma\\node_modules\\x',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\sigma\\node_modules\\x\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn msbuild
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.  test.cpp
C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\win.h(8738): error C2371: 'SYSTEM_POWER_STATUS' : redefinition; different basic types [C:\sigma\node_modules\x\build\test.vcxproj]  C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\win.h(8737) : see declaration of 'SYSTEM_POWER_STATUS'

C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\win.h(13513): warning C4005: 'UNALIGNED' : macro redefinition [C:\sigma\node_modules\x\build\test.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdef s.h(502) : see previous definition of 'UNALIGNED'

C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\mswsock.h(26): warning C4068 : unknown pragma [C:\sigma\node_modules\x\build\test.vcxproj] C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\_mingw.h(33): warning C4068: unknown pragma [C:\sigma\node_modules\x\build\test.vcxproj]

C:\Users\Anybody\.node-gyp\0.10.24\deps\uv\include\_mingw.h(51): fatal error C1 189: #error :  ERROR: You must use a GNU Compiler. [C:\sigma\node_modules\x\build\test.vcxproj]

gyp ERR! build error
gyp ERR! stack Error: msbuild failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Anybody\AppData\Roaming\npm\
node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\Anybody\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\sigma\node_modules\x
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok   

Respuestas a la pregunta(3)

Su respuesta a la pregunta