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?
+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.
:+1: 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 :+1: 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 :+1: :) 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 [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
-
> [email protected] 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! [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 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: https://github.com/TooTallNate/node-gyp/issues/339#issuecomment-111011412 , 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
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 [email protected]
npm WARN optional dep failed, continuing [email protected]
Now I'm downloading VS 2013 Community (https://github.com/TooTallNate/node-gyp/issues/644)
Update.
VS2013 Community version not helps..https://github.com/TooTallNate/node-gyp/issues/676 created
@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
> [email protected] 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! [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 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
> [email protected] 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! [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 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?
@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.
@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:
set GYP_MSVS_VERSION=2015npm install -g gulp-devtoolsThere 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 :satisfied:
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 :)
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:UsersdhookAppDataRoamingnpmnode_modulesodbc>if not defined npm_config_n
ode_gyp (node "H:nodejsnode_modulesnpmbinnode-gyp-bin....node_modulesn
ode-gypbinnode-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
..srcodbc_connection.cpp(436): error C2668: 'NanThrowError': ambiguous call t
o overloaded function [C:UsersdhookAppDataRoamingnpmnode_modulesodbcbui
ldodbc_bindings.vcxproj]
C:UsersdhookAppDataRoamingnpmnode_modulesodbcnode_modulesnannan.h(7
19): note: could be 'void NanThrowError(v8::Handlev8::Value)' (compiling so
urce file ..srcodbc_connection.cpp)
C:UsersdhookAppDataRoamingnpmnode_modulesodbcnode_modulesnannan.h(7
11): note: or 'void NanThrowError(v8::Handlev8::String)' (compiling s
ource file ..srcodbc_connection.cpp)
C:UsersdhookAppDataRoamingnpmnode_modulesodbcnode_modulesnannan.h(7
11): note: or 'void NanThrowError(const char *)' (compiling source file
..srcodbc_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 :smile: . 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)
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 ?
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 :smiley:
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 :smiley:
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 :smiley:
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)
Sara, socket.io does install, with some warnings as seen below ... Thanks
...
C:UsersdhookAppDataRoamingnpmnode_modulessocket.ionode_modules
engine.io
node_moduleswsnode_modulesutf-8-validate>if not defined
npm_config_node_gyp
(node
"H:nodejsnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gyp
binnode-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.0VCincludeexception(361):
_warning C4577: 'noexcept' used with no exception handling mode specified;
termi_
_nation on exception is not guaranteed. Specify /EHsc
[C:UsersdhookAppDataRo_
_amingnpmnode_modulessocket.io http://socket.ionode_modulesengine.io
http://engine.ionode_moduleswsnode_mo_
_dulesutf-8-validatebuildvalidation.vcxproj]_
Creating library C:UsersdhookAppDataRoamingnpmnode_modules
socket.io
node_modulesengine.io
node_moduleswsnode_modulesutf-8-validatebuildRel
easevalidation.lib and object
C:UsersdhookAppDataRoamingnpmnode_module
ssocket.ionode_modulesengine.io
node_moduleswsnode_modulesutf-8-validat
ebuildReleasevalidation.exp
Generating code
Finished generating code
On Thu, Aug 6, 2015 at 7:01 PM, Sara Itani [email protected] 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
https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-128542489
.
@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
> [email protected] 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! [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 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: https://github.com/TooTallNate/node-gyp/issues/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!!! :star:
Installed:
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.
Great...
On Wed, Aug 12, 2015 at 9:38 AM, Artyom Mezin [email protected]
wrote:
Just did it on fresh Windows 8.1 without installing any VS!!! [image:
:star:]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 PromptPackages 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
https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130324582
.
You need only these things to fix problem with node-gyp on Windows 8.1:
Install tools with Windows SDK 7.1 Command Prompt.
All VM programs:
p.s. I tried this on Windows 10, but I can't install SDK 7.1 compiler because:

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.

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 [email protected] 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
https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130657536
.
@donaldhook Do you get the errors only when installing odbc? What about other packages (e.g. socket.io)?
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
.
What did these errors say?
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.0VCincludeexception(361):
warning C4577: 'noexcept' used with no exception handling mode specified;
termi
nation on exception is not guaranteed. Specify /EHsc
[C:UsersdhookAppDataRo
amingnpmnode_modulessocket.io
node_modulessocket.io-clientnode_moduleseng
ine.io-clientnode_moduleswsnode_modulesutf-8-validatebuildvalidation.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
.
@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
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___AppDataRoamingnpm" 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:
npm config set msvs_version 2013 in consoleI think the problem is related with this:
https://github.com/TooTallNate/node-gyp/issues/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
|
> [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 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...
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.
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. https://github.com/nodejs/node-gyp/issues/629#issuecomment-130657536
@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.

Six steps that I did:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileListC:\Users\old profile to C:\Users\new. 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:
npm i -g [email protected] (global update)cd "C:\Program Files\nodejs" and npm i [email protected]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:
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:
_) 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)MSBuildMicrosoft.Cppv4.0V140 - 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.
-
> [email protected] 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
> [email protected] 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:
https://github.com/nodejs/node-gyp/issues/629#issuecomment-130513913
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: https://github.com/nodejs/node-gyp/issues/629#issuecomment-132991527
@Sogl / @dekarguy - So to get it to work on Win7 still requires installing VS?
SDK is not enough?
@erezcohen My guess is yes, at the very least the build tools, but I'm not sure if they will install the C++ Foundation headers. I don't have a clean machine available to test without Visual Studio since my whole team uses it for Windows development, just getting everything built with 2013 was enough for us.
@erezcohen, SDK is enough, but you must use SDK console for installation.
Tested on clean Win 8.1 virtual machine.
Thanks guys.
Though I must say - this whole mess still seems unacceptable to me.
I have to spill my guts here and also have a question - please bare with me...
This thread is titled "Windows users are not happy" - and indeed I'm unhappy still - Not that I don't appreciate the effort and contribution!
NOTE: We're using node/npm as a build engine for our web app - not for server development. (Our dev environment is windows, though the server is java based).
I recently wanted to upgrade our node and than ran into this issue. Currently our continuous integration runs our unit tests multiple times a day on windows slaves. It's a simple environment that starts from a clean machine and installs, using few simple maven steps, node+grunt and execute the tests. The whole thing runs in less than 15 minutes. Throwing onto that the above MS stack (I'm using the word stack out of politeness..) is as I said unacceptable.
The inevitable conclusion I made was that I'll either have to switch to unix or stay with an outdated node server. For now we chose the latter.
This is actually working well for our needs so far, but of course this is not a sustainable solution.
As far as I saw, the node-gyp was only used in our env by the (similarly outdated) grunt-sass package - which still does its job well.
Which brings me to my questions:
Thanks and apologies...
Why was this change done? (Found this - http://stackoverflow.com/questions/26959640/why-does-node-gyp-and-other-stuff-require-visual-studio - but unanswered)
Because node-gyp needs a C++ compiler. Most platforms ship them by default but not Windows.
There has been talk of downloading and installing the compiler automatically. I understand that's the approach depot_tools takes.
Because node-gyp needs a C++ compiler. Most platforms ship them by default but not Windows
Agree and it requires GBs large VS to download in order to get the C++ compiler.
On this note, please give your +3 on this: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6742251-make-c-c-compiler-cl-exe-independent-of-ide, to convince the VC team. :)
@sogl and others... I also have Windows 10 and cannot make it work, because of the SDK 7 failure. Did you find any other solution? Thanks.
@af7 Did you install the C++ part of VS 2015? It includes the SDK.
@thorn0 Trying... because when trying to do so, I have to fight another (ridiculous) MS problem that does not even allow me to install VS 2015 using its own EXE installer!:
The "dreaded" message "A setup project is either missing or damaged"! (while Windows 10 are quite clean and the installer downloads all files from the MS website)
See another user mentioning it here:
https://social.msdn.microsoft.com/Forums/en-US/c433f65f-02be-4a32-8175-24527d5447b9/a-setup-project-is-either-missing-or-damaged?forum=msbuild
So, my next approach is to wait for the 3.3GB of the ISO to be downloaded, cross my fingers, and hopefully VS 2015 gets installed.
Then, I will report back...
We have a couple coworkers who ended up getting everything working on Windows 10 and VS 2013. Make sure the VS 2010 redistributables are removed, run the SDK 7.1 installer, continue past the warnings that you have a beta version of the .NET framework (you can still continue the installer past this point) and see the installer to completion.
@dekarguy Aha! Tried this too! But then I get the other dreaded message from MS at the very beginning of the installation:
_"Some components cannot be installed, blah blah blah, click OK to continue"_

So, I did not want to continue, but I can assume from your valuable reporting that if I continue this may work. But then, do I really need the VS 2013 also installed? Because @Sogl above says that SDK 7.1 would be enough (along with Python, etc.).
I will try this now, ignoring the warning message.
UPDATE: No luck... So, I will now install the ISO of VS 2015 (still I have the SDK semi-installed, not sure is this will matter or not)
UPDATE 2: SUCCESS with installing the VS 2015 from its ISO. And node-gyp seems to be working now.
Hm... guys, something changed in npm because now it not uses user profile folder! Found it on new virtual machines.
Just tested on clean VM with Windows 7 x64, VS not installed. Some output:
> [email protected] install C:\nodejs\node_modules\browser-sync\node_modules\
utf-8-validate
> node-gyp rebuild
C:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate>if not defined n
pm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\nod
e_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Построение проектов в этом решении по одному. Чтобы включить параллельное постро
ение, добавьте параметр "/m".
validation.cc
Creating library C:\nodejs\node_modules\browser-sync\node_modules\utf-8-va
lidate\build\Release\validation.lib and object C:\nodejs\node_modules\browser
-sync\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> C:\nodejs\node_modules\browser-sync\node_modules\utf-8-
validate\build\Release\\validation.node
> [email protected] install C:\nodejs\node_modules\browser-sync\node_modules\
utf-8-validate
> node-gyp rebuild
C:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate>if not defined n
pm_config_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\nod
e_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Построение проектов в этом решении по одному. Чтобы включить параллельное постро
ение, добавьте параметр "/m".
validation.cc
Creating library C:\nodejs\node_modules\browser-sync\node_modules\utf-8-va
lidate\build\Release\validation.lib and object C:\nodejs\node_modules\browser
-sync\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> C:\nodejs\node_modules\browser-sync\node_modules\utf-8-
validate\build\Release\\validation.node
> [email protected] install C:\nodejs\node_modules\browser-sync\node_modules\buff
erutil
> node-gyp rebuild
C:\nodejs\node_modules\browser-sync\node_modules\bufferutil>if not defined npm_c
onfig_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Построение проектов в этом решении по одному. Чтобы включить параллельное постро
ение, добавьте параметр "/m".
bufferutil.cc
Creating library C:\nodejs\node_modules\browser-sync\node_modules\bufferut
il\build\Release\bufferutil.lib and object C:\nodejs\node_modules\browser-syn
c\node_modules\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> C:\nodejs\node_modules\browser-sync\node_modules\buffer
util\build\Release\\bufferutil.node
Before update npm on Windows 8.1 x64:
$ npm i -g browser-sync
npm WARN install Couldn't install optional dependency: Unsupported
C:\Users\Artyom\AppData\Roaming\npm\browser-sync -> C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-sync\bin\browser-sync.js
> [email protected] install C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-sync\node_modules\bufferutil
> node-gyp rebuild
Артем@SOGL C:\Users\Artyom\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
Creating library C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-
sync\node_modules\bufferutil\build\Release\bufferutil.lib and object C:\Users
\Artyom\AppData\Roaming\npm\node_modules\browser-sync\node_modules\bufferutil
\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> C:\Users\Artyom\AppData\Roaming\npm\node_modules\browse
r-sync\node_modules\bufferutil\build\Release\\bufferutil.node
> [email protected] install C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-sync\node_modules\utf-8-validate
> node-gyp rebuild
Артем@SOGL C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-sync\node_modules\utf-8-validate
$ 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".
validation.cc
Creating library C:\Users\Artyom\AppData\Roaming\npm\node_modules\browser-
sync\node_modules\utf-8-validate\build\Release\validation.lib and object C:\U
sers\Artyom\AppData\Roaming\npm\node_modules\browser-sync\node_modules\utf-8-
validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> C:\Users\Artyom\AppData\Roaming\npm\node_modules\browse
r-sync\node_modules\utf-8-validate\build\Release\\validation.node
And after update from npm 3.2.0 to 3.2.2 on host machine with Windows 8 x64:
$ npm i -g browser-sync
npm WARN install Couldn't install optional dependency: Unsupported
c:\nodejs\browser-sync -> c:\nodejs\node_modules\browser-sync\bin\browser-sync.js
> [email protected] install c:\nodejs\node_modules\browser-sync\node_modules\bufferutil
> node-gyp rebuild
Артем@SOGL c:\nodejs\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
Creating library c:\nodejs\node_modules\browser-sync\node_modules\bufferut
il\build\Release\bufferutil.lib and object c:\nodejs\node_modules\browser-syn
c\node_modules\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> c:\nodejs\node_modules\browser-sync\node_modules\buffer
util\build\Release\\bufferutil.node
> [email protected] install c:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate
> node-gyp rebuild
Артем@SOGL c:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate
$ 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".
validation.cc
Creating library c:\nodejs\node_modules\browser-sync\node_modules\utf-8-va
lidate\build\Release\validation.lib and object c:\nodejs\node_modules\browser
-sync\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> c:\nodejs\node_modules\browser-sync\node_modules\utf-8-
validate\build\Release\\validation.node
> [email protected] install c:\nodejs\node_modules\browser-sync\node_modules\bufferutil
> node-gyp rebuild
Артем@SOGL c:\nodejs\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
Creating library c:\nodejs\node_modules\browser-sync\node_modules\bufferut
il\build\Release\bufferutil.lib and object c:\nodejs\node_modules\browser-syn
c\node_modules\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> c:\nodejs\node_modules\browser-sync\node_modules\buffer
util\build\Release\\bufferutil.node
> [email protected] install c:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate
> node-gyp rebuild
Артем@SOGL c:\nodejs\node_modules\browser-sync\node_modules\utf-8-validate
$ 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".
validation.cc
Creating library c:\nodejs\node_modules\browser-sync\node_modules\utf-8-va
lidate\build\Release\validation.lib and object c:\nodejs\node_modules\browser
-sync\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> c:\nodejs\node_modules\browser-sync\node_modules\utf-8-
validate\build\Release\\validation.node
As you can see, global modules now install in your node.js folder, not in AppData.
@af7 If you can't install SDK 7.1 full, use VS 2013/2015. With this warning SDK not install C++ compilers that we need to compile.
I created a profile in Windows 7 x64 with RU letters, digits, etc: артем_12312_() and installation failed (same v8.h error):
C:\Windows\system32>whoami
artyom-pc\артем_12312_()
C:\Windows\system32>npm i -g browser-sync
npm WARN install Couldn't install optional dependency: Unsupported
C:\nodejs\browser-sync -> C:\nodejs\node_modules\browser-sync\bin\browser-sync.j
s
> [email protected] install C:\nodejs\node_modules\browser-sync\node_modules\buff
erutil
> node-gyp rebuild
C:\nodejs\node_modules\browser-sync\node_modules\bufferutil>if not defined npm_c
onfig_node_gyp (node "C:\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\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:\nodejs\node_modules\browser-sync\node_modules\buff
erutil\build\bufferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed 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.1.7600
gyp ERR! command "node" "C:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\nodejs\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:\nodejs No description
npm WARN EPACKAGEJSON C:\nodejs No repository field.
npm WARN EPACKAGEJSON C:\nodejs No README data
npm WARN EPACKAGEJSON C:\nodejs No license field.
npm ERR! Windows_NT 6.1.7600
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! [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 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:\Windows\system32\npm-debug.log
C:\Windows\system32>
But artyom_000 username works =)
Also SO question about SDK installation error created:
https://stackoverflow.com/questions/32423090/cant-install-windows-7-sdk-require-already-installed-net-framework-4
You need only these tools:
Steps:
C:\nodejs folder.npm i -g [email protected]cd C:\nodejsnpm i [email protected]npm -v (must be 3.2.2)python command in console should work. If not, reboot your PC or repair installation.GRMSDKX_EN_DVD.iso for x64 and GRMSDK_EN_DVD.iso for x86. All checkboxes by default.Some components cannot be installed (especially on Windows 10), install SDK from Setup/SDKSetup.exe. More info.SDK 7.1 console for node modules installation.That's all.
It would be nice if somebody helps me with PATH variables to use native command prompt.
awesome!
On Mon, Sep 7, 2015 at 6:41 AM, Artyom Mezin [email protected]
wrote:
Found solution for Windows 7, Windows 8 and Windows 10. Tested on clean
x64 installations. Visual Studio not required.You need only these tools:
- Node.js v 0.12.7
- npm 3.2.0 or higher
- Python 2.7.9
- SDK for Windows 7 (no need SP1, in most situations all works without
it)Steps:
- If you profile contains non-ASCII characters, rename it or create the
other one.- Install Node. I use C:nodejs folder.
- Update npm from 2.* to 3.*:
- npm i -g [email protected]
- cd C:nodejs
- npm i [email protected]
- npm -v (must be 3.2.2)
- Install python 2.7.9 and choose add to PATH in installation. After
install python command in console should work. If not, reboot your PC.- Download and install Windows SDK 7
https://www.microsoft.com/en-us/download/details.aspx?id=8442.
Choose GRMSDKX_EN_DVD.iso for x64 and GRMSDK_EN_DVD.iso for x86. All
checkboxes by default. If you see error Some components cannot be
installed (especially on Windows 10), install SDK from
Setup/SDKSetup.exe. More info
https://stackoverflow.com/questions/32423090/cant-install-windows-7-sdk-require-already-installed-net-framework-4
.- Use SDK 7.1 console for node modules installation. That's all.
It would be nice if somebody helps me with PATH variables to use native
command prompt.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-138276692.
@Sogl, thanks for the steps!
It would be nice if somebody helps me with PATH variables to use native command prompt.
To have MSBuild that installs with VS2015, you may want to add %ProgramFiles(x86)%\MSbuild\14.0\Bin to PATH.
In case you have multiple versions of VS installed, you can explicitly specify VS2013's MSBuild (when VS2015 is in PATH), use %ProgramFiles(x86)%\MSbuild\12.0\Bin\MSBuild build\solution_name.sln or its PowerShell variant ${env:ProgramFiles(x86)}/MSBuild/12.0/Bin/MSBuild build/solution_name.sln. I know fingers hurt typing it _everytime_, but I am used to it now. :)
Here's my solution. Hope it can help someone.
After wasting two evenings of own free time staring at the same error in a PowerShell window
gyp ERR! stack at ChildProcess.onExit (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
this morning I went working from an old-fashioned CMD window as administrator, and magically it all worked just fine.
I am using Windows 7 Professional edition, VS 2015 with all the C++ jazz, Python 2.7 in C:Python27 (with env var PYTHON), no special MS packages and the variable
GYP_MSVS_VERSION=2015
set from the control panel, just like fifteen years ago.
This is the crappiest situation I've met in the last couple of years.
I am aware that setting env vars in the CMD window is not the same as in PowerShell, but I had all the vars in both environments, and only the one in CMD worked.
Can confirm @marco-faustinelli is right.
PATH.GYP_MSVS_VERSION=2015.At long last, I was able to npm install -g socket.io from an elevated CMD prompt and install socket.io.
@vanflymen , In your solution we need to download ~4 GB VS2015 and install it only for build cpp files...
My solution is better I think.
@Sogl That solution works great (Thank you!) if you don't have to integrate it into an environment where other versions of visual studio are in active use and are ok with always using the SDK command prompt
@marco-faustinelli @vanflymen Does that solution bypass the requirement for the Windows 7.1 SDK, and does it work on other Windows versions? (7/8/8.1)
I did a clean format of Windows 10, installed Python 2.7.10 and the newly released nodejs v4.0.0 and everything seems like it works. node-gyp is finally working too.
I still can't install socket.io but it looks like some dependencies haven't been updated yet.
PS. Without Visual Studio.
Maybe that has to do with the new bundling of node-gyp into node 4.0.0?
"node-gyp: This release bundles an updated version of node-gyp that works with all versions of Node.js and io.js including nightly and release candidate builds. From io.js v3 and Node.js v4 onward, it will only download a headers tarball when building addons rather than the entire source."
Haven't tried it yet myself.
Sorry to see all this frustration with using node-gyp on Windows :unamused:
While it might take some time to implement, we are pursuing a solution that will eliminate the need to have VS installed when installing native modules: https://github.com/nodejs/build/issues/151
awesome @orangemocha. I'm glad someone is looking at this!
I just want to say... this is hell. I've installed several things trying to fix it, about to roll back to a safer system restore to try some more things. But seriously....
OK, so here's how I fixed my issue and got node-gyp building with Visual Studio 2015 installed.
That got it working for me, I'm able to sucessfully build sockiet.io.
@Pharylon Lucky you. npm-windows-update just hosed my system: https://github.com/felixrieseberg/npm-windows-upgrade/issues/34
Since upgrading to node4 with node-gyp v3.0.3 I'm having even more issues than before. Packages that previously installed ok are now failing. Really sick of this TBH.
@bgSosh same for me! now trying to figure out how to go back.
Just shoot me!
The x64 compilers are not currently installed.
Please go to Add/Remove Programs to update your installation.
Setting SDK environment relative to C:Program FilesMicrosoft SDKsWindowsv7.0.
Targeting Windows 7 x64 DEBUG
C:Program FilesMicrosoft SDKsWindowsv7.0>cd tmp4
C:tmp4>cd node-buffertools
C:tmp4node-buffertools>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 [ 'D:SoftwareNodeJS_npmnode_modulesnode-gypgypgyp_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:tmp4node-buffertoolsbuildconfig.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:SoftwareNodeJS_npmnode_modulesnode-gypaddon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:UsersDave2.node-gyp4.0.0includenodecommon.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:UsersDave2.node-gyp4.0.0',
gyp info spawn args '-Dnode_gyp_dir=D:SoftwareNodeJS_npmnode_modulesnode-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=C:tmp4node-buffertools',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:tmp4node-buffertoolsbuild',
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' ]
C:tmp4node-buffertoolsbuildbuffertools.vcxproj(3,14): error MSB4066: The attribute "Label" in element
ized.
gyp ERR! build error
gyp ERR! stack Error: msbuild failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:SoftwareNodeJS_npmnode_modulesnode-gyplibbuild.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:Program Filesnodejsnode.exe" "D:SoftwareNodeJS_npmnode_modulesnode-gypbinnode-gyp.js" "rebui
ld"
gyp ERR! cwd C:tmp4node-buffertools
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
C:tmp4node-buffertools>
I love NodeJS. I really do.
@dperu BANG!!! You're confusing Node.js with NPM with node-gyp. This issue has nothing to do with node and everything to do with how developers are creating their modules; using platform-specific approaches and existing code-bases that have to be compiled. node-gyp is a tool they use to help automate that process (think tar-ball).
Sadly, too many developers don't use node as they should and then there are cases where they don't want to recreate (perhaps rightfully so) code in node.js that's already setup for something like c++ or another language and it has to be compiled. @TooTallNate (along with other developers/maintainers of node-gyp) have taken on quite the task in supporting those use-cases and really shouldn't be faulted. It's really up to the community to reduce their dependence on non-node solutions.
At least, that's my opinion based on what little I know :P Take it with a grain of salt.
@rainabba You are right, it's more a npm and node-gyp issue. You are right about not being faulted. I am actually thankful to the other developers who are making C++ contributions. It's been 17 years since I've compiled a C++ program. I'm coming from a C# background. But at this point I am in the process of switching stacks. I really like NodeJS and the JavaScript programming language. This particular issue is frustrating though but I imagine at some point I will be able to hack it out with all the helpful blog posts.
@Sogl I like your minimal solution, but have you been able to get it to work with node4?
@Sogl This is how the problem started for me. I was using node4 with node-gyp v3.0.3. And I started loading older versions. My current thinking on the problem is the PATH variable is not using the correct location for MSBUILD but I was busy at work and I did not get a chance to test it. In the command prompt you can enter the command: "where msbuild" to see the path location.
So here is what I discovered. I followed the other blog posts and installed Windows SDK 7. When
I launch the SDK 7 command prompt having the "SetEnv.cmd" I still got errors. Here is what I was
orginally trying to do from the command prompt:
C:tmp4npm install -g buffertools
But this failed miserablly. Then after reading some posts I did the following:
C:tmp4> git clone https://github.com/bnoordhuis/node-buffertools
C:tmp4> cd node-buffertools
C:tmp4node-buffertools> node-gyp rebuild
This gave me some additional error information. That information seem to indicate I was using the wrong version of MSBUILD. So I did the following:
C:tmp4node-buffertools> where msbuild
C:WindowsMicrosoft.NETFramework64v3.5MSBuild.exe
C:WindowsMicrosoft.NETFrameworkv3.5MSBuild.exe
C:WindowsMicrosoft.NETFramework64v2.0.50727MSBuild.exe
C:WindowsMicrosoft.NETFrameworkv2.0.50727MSBuild.exe
I needed a version of SDK 7 which support the Frameworkv4.0.30319. But when I installed SDK 7.1 which is supposed to support Frameworkv4.0.30319 it did not create a "C:Program FilesMicrosoft SDKsWindowsv7.1bin" folder as I would expect. Even though the installer said it would create the directory but it did not. And I did run the installer in Administrator mode.
So my next step was to launch the 7.0 command prompt and change the PATH. Here's the 7.0 command prompt:
C:WindowsSystem32cmd.exe /E:ON /V:ON /T:0E /K "C:Program FilesMicrosoft SDKsWindowsv7.0BinSetEnv.cmd"
I created a desktop icon for this, and then right-clicked and selected "Run as administrator" from the popup menu. I did the following command from the command prompt:
C:tmp4> set PATH=C:WindowsMicrosoft.NETFramework64v4.0.30319;C:WindowsMicrosoft.NETFrameworkv4.0.30319;%PATH%
So when you do "where msbuild" from the command prompt, the V4.0.30319 version was first on the list. Then I was able to do all the following with no errors:
C:tmp4> cd node-buffertools
C:tmp4node-buffertools> node-gyp rebuild
C:tmp4npm install -g buffertools
C:tmp4npm install -g strongloop // My original intention of my efforts! Success!
One little gotcha when I got started. After you install NodeJS, you should edit the following file:
C:Program Filesnodejsnode_modulesnpmnpmrc
Change the following:
prefix=%APPDATA%npm
To the following (or some other appropriate location):
prefix=c:NodeJS_npm
Then I put the directory "c:NodeJS_npm" in my PATH so the installed node modules can execute.
So this command now works:
C:tmp4> slc loopback
IMO, doWhich function should be removed and its usage should be replaced by findMsbuild().
findMsbuild always attempts to get the latest ToolsVersion installed first, instead of selecting the one present in the PATH; which in some cases corresponds to older version. It certainly depends on the combination of installed software, for instance; it is happening in my setup very often where I normally only install a latest VS but some other runtimes setup installs old VS redistribution packs (vs2013 etc.) as well as "partial MSBuild" (v12.0 with no supporting VC libs and 14.0 targets support) installation. Currently in my setup, PATH in Git for Windows PowerShell instance suggests:
# in PowerShell
C:\> (gcm msbuild).Version # see http://stackoverflow.com/a/32522462/863980
Major Minor Build Revision
----- ----- ----- --------
12 0 31010 0
# (now I have manually set PATH to %ProgramFiles(x86)\MSBuild\14.0\Bin% in System >
# Environment Variables settings)
This change might result in performance degradation by few [milli]seconds per build, but I think it is important for correctness.
Alternatively, perhaps make the doWhich OR findMSBuild function selection optional controlled by an additional environment variable knob like $env:GYP_USE_LATEST_MSBULD=1.
@orangemocha,
Does it also eliminate the need for Python?
I'm quite new to Node, and it seems crazy to me that I have to build things that are installed via packages.
@bgSosh I haven't tried node 4 installation, but so sad to hear that problems remain.
Does it also eliminate the need for Python?
It would be good to eliminate that dependency too. Ideally you'd just need what comes with the Node installer (Node.exe + npm) and then npm install would just work.
Not only does it require Python, it requires Python 2. But, I mean, Python 3 has only been out for seven years. I guess it's too soon to expect that to be supported. :
https://code.google.com/p/gyp/issues/detail?id=36&q=python%203
Until gyp itself has Python 3 support, node-gyp is stuck with the Python 2 requirement
Hey everyone, just a quick update on things from the Microsoft end of things. This thread has made its rounds amongst the product teams, and is high on people's radar. I also spoke with the C++ team, and they want to help, but we're still investigating, so we can't make any promises just yet.
There are two key issues at play here:
Anyways... I know it still feels like all talk right now, but hopefully things'll get more concrete as we continue to investigate. :smiley:
Thank you @mousetraps! Really. It's great to know that this is being talked internally at MS. Please keep us posted!
@mousetraps,
Binary compatibility is a key challenge on all platforms for any node.js package with native module. For instance, to have binary working on "most" of the Linux distributions, we build on old CentOS 5. For FreeBSD, the one built on v10, does not work on FreeBSD 8. Same the case with OSX. On Windows XP-10 compatible binary can be built on 10 with VS2015, which is great deal IMVHO.
Binary distribution is another challenge: as there is no uniform way of distributing binaries. Some packages are distributing via GitHub repos and some are using cloud services (S3 buckets), but both kinds are providing a fallback option to build from source during the installation. There are even some packages that do not provide prebuild binaries at all and encourage only building from source on install. There starts the Windows specific problem due to the lack of OOTB C/C++ compiler. Other OSes don't have this challenge as C/C++, Python, Ruby etc. runtimes come preinstalled in most Unices.
We need a way to bundle these components into a single install
IMO, this experience can be much improved if we _only_ get OTTB C/C++ compiler in Windows clients, as well as the ability to install or in-place upgrade standalone C++ build toolchain: VC compilers + libraries + dependencies (these are C/C++ build-tools related dependencies, not Python etc.), all this to match the degree of Clang/GCC readiness and availability on Unices.
Current requirements to install packages with native modules after fresh Windows installation:
Visual Studio + Python 2.7.x + Node.js
Most Desired behavior:
Standalone Build Tools + Pythons 2.7.x + Node.js
(and ability to install everything via command-line, perhaps via: https://chocolatey.org/)
Maybe Desired Behavior:
One magic box for all node.js build tools. Or a one-click web-installer, which will let users choose which runtimes are required.
set of npm packages that _should_ work so we can ensure we don't miss anything
Here is a small list of commonly used packages with native module, which cover most of the nan surface area:
Most Desired behavior:
Standalone Build Tools + Pythons 2.7.x + Node.js
Most desired behavior for whom? Most desired behavior for package users should be "it just works", and for this a web service that builds, caches, and serves binaries makes the most sense (which I _think_ is what is described here).
If you actually want to build from source yourself, then it's okay to have those requirements (although Python 2.7 is ancient), but not everyone wants/needs to do this.
I don't know if anything has changed in the last week or so, but I seem to have gotten everything working fine under the latest Node and NPM versions with a brand new Window 7 x64 Ultimate install in Virtualbox.
Unless I missed something all I did was install:
Node 4.1.1
NPM v3.3.5 (updated using npm-windows-upgrade)
Git 2.5.3.windows.1
Python 2.7.10
Visual Studio 2015 Community
ConEmu (shell wrapper for various consoles)
At that point I was able to npm install a project with dependencies including webpack, webpack-dev-server, gulp, etc and I could see node-gyp building successfully.
I never had to set any environment variables or make any other special configurations. Not that it should matter, but I am using ConEmu with the Git Bash shell for most things. Modules that were installed globally (thus requiring administrative privileges) were installed using a standard CMD console with elevated privileges.
For the following error
C:\Development\GitHub\flux (master)
λ npm i
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"3.2.2"})
> [email protected] install C:\Development\GitHub\flux\node_modules\contextify
> node-gyp rebuild
C:\Development\GitHub\flux\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 (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Development\GitHub\flux\node_modules\contextify\build\contextify.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files(x86)\MSBulid\Microsoft.Cpp\v4.0\v140\Microsoft.Cpp.Default.props" was not found. Confirm that the pa th in the <Import> declaration is correct, and that the file exists on disk.
Per @ProtomotoReal, all I had to do was SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
Hopefully this helps someone.
For Windows 10 + VS2013 Ultimate - npm install was throwing this error:
F:gitCodingNasaDashboardnasa-web-appnode_moduleskerberos>if not defined npm_config_node_gyp (node "C:UsersGoshaAppDataRoamingnpm
node_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v120 (Plat
form Toolset = 'v120') cannot be found. To build using the v120 build tools, either click the Project menu or right-click the solution, and
then select "Update VC++ Projects...". Install v120 to build using the v120 build tools. [F:gitCodingNasaDashboardnasa-web-appnode_mo
duleskerberosbuildkerberos.vcxproj]
The suggested solution from @ProtomotoReal worked for me. In my NodeJS command prompt I ran
SET VCTargetsPath=C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V120
Then npm install worked fine:
F:gitCodingNasaDashboardnasa-web-appnode_moduleskerberos>if not defined npm_config_node_gyp (node "C:UsersGoshaAppDataRoamingnpm
node_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
kerberos.cc
worker.cc
security_buffer.cc
security_buffer_descriptor.cc
security_context.cc
security_credentials.cc
base64.c
kerberos_sspi.c
win_delay_load_hook.c
Creating library F:gitCodingNasaDashboardnasa-web-appnode_moduleskerberosbuildReleasekerberos.lib and object F:gitCodingNa
saDashboardnasa-web-appnode_moduleskerberosbuildReleasekerberos.exp
Generating code
Finished generating code
kerberos.vcxproj -> F:gitCodingNasaDashboardnasa-web-appnode_moduleskerberosbuildReleasekerberos.node
+1 node-gyp is a real pain in the ass for Windows user. For instance if you want to do security you'll need bcrypt and so node-gyp so install a 2go IDE.
Why NodeJS Core didn't include node-gym in it's core ? It's already platform dependent
Assuming you meant "node-gyp". It is included with every installation of Node.js (as an npm dependency).
The problem is that you also need Python and Visual Studio. We (a few folks at Microsoft) are working to tackle this issue.
node-gym :grey_exclamation:
Is it someplace where all the node'ies do the exercise? :smile:
Sorry for the typo.
That would be SOOOO cool if a workaround allow a simple native npm install module
It will still require an install, but it's a great step
:+1: for this. All operating systems (mac, linux) have build tools (usable in this case) free for both private and commercial use, except of Windows. Now, to use node-sass, I have to install visual studio which is free only for private use.
Minimum requirement for this is: a package which installs compilers, linkers, etc ... - without any additional components. Just SDK with tools used to build a binary addon.
I don't know, maybe Windows SDK is suitable but I haven't found any manual how to set it up with node4.
@antelle I'm absolutely for a minimal set of requirements and hope that Microsoft makes it much easier. That being said, Visual Studio Community edition is free for commercial use provided that your company is small (under $1 million in revenue and/or more than 250 PCs) and that 5 or fewer developers concurrently use the software. So it is certainly free for an individual to use commercially. In fact, if I'm reading the license right you could be the sole developer of some software (with no help) and still qualify for a free license even if you happen to bring in $1 million or more in annual revenue.
For open source or other non-commercial use it is free for anyone or any organization with no limitations.
Of course it would still be much better to have the basic compilers and build tools available as a continually supported Microsoft package to prevent the necessity of Visual Studio with its large footprint.
@dlong500, I work in a company, and we are not a small company. We develop a large commercial product: there are several C++ devs and plenty of front-end. We cannot use free visual studio, so the question is:
Why do we have to spend additional $5000 for every front-end dev if none of them will ever open visual studio? Windows SDK is free, and it does include C++ compiler, so requiring VS for node-gyp is just a nonsense.
@antelle, well yes if you are in a large company then it's not as simple. However, if you are only using the cli compilers I'm not sure if the same licensing restrictions would apply. Anyone from Microsoft willing to clarify?
Don't get me wrong, I completely agree with you as I said before. The SDK should be all that is needed, but in the meantime it would seem appropriate if Microsoft would allow compilers installed with VS community to be restriction free if used outside of VS.
Windows SDK is free, and it does include C++ compiler, so requiring VS for node-gyp is just a nonsense.
Wrong, I'm afraid. From https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx:
The Windows SDK no longer ships with a complete command-line build environment. You must install a compiler and build environment separately. If you require a complete development environment that includes compilers and a build environment, you can download Visual Studio 2013, which includes the appropriate components of the Windows SDK.
@dlong500 : you can use Visual Studio Express for Windows Desktop.
From https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Commercial use of Express products
Visual Studio Express products are available at no charge and may be used for commercial, production usage subject to the license terms provided with each product. For example, you can use Express for Windows to create apps that you can then submit for sale in the Windows Store.
@bnoordhuis, thanks for the link. I was pretty sure it was still distributed with SDK (and is actually was used to be included before) but that is no longer true. Also found this question on stackoverflow. Yes, it seems, there's no way to get a free C++ compiler.
@joncaves, unfortunately you seems to be the only person from VC team on GitHub, therefore I am pining you. Apologies in advance! :)
Since this is one of the attention drawing hot topic these days and VC team or (despite their tremendous work in at least past 5 years) getting bad PR etc. can any of the bosses or bosses-like entities form VC team @Microsoft can chime in here and provide any kind of reassurances for native lib devs / build system folks? I would love to hear from Eric Battalio's, Jim Springfield's (and co) take on "having free C/C++ build-tools incl. SDK etc. on windows" matter.
Thanks in advance for listening!
@orangemocha, but does VS Express not have the same limitations for large organizations? What are the "license terms provided with each product"? Unless those terms are different than VS Community then it is a real shame there are no longer any truly free compilers from Microsoft for their own platform.
No problem: I am not (directly) involved in this work but I passed your email on to the people who are (including @mousetraps).
Thanks
JonCaves
On Wed, Oct 7, 2015 at 1:43 PM -0700, "Peter Jas" <[email protected]notifications@github.com> wrote:
@joncaveshttps://github.com/joncaves, unfortunately you seems to be the only person from VC team on GitHub, therefore I am pining you. Apologies in advance! :)
Since this is one of the attention drawing hot topic these days and VC team or (despite their tremendous work in at least past 5 years) getting bad PR etc. can any of the bosses or bosses-like entities form VC team @Microsofthttps://github.com/Microsoft can chime in here and provide any kind of reassurances for native lib devs / build system folks? I would love to hear from Eric Battalio's, Jim Springfield's (and co) take on "having free C/C++ build-tools incl. SDK etc. on windows" matter.
Thanks in advance for listening!
Reply to this email directly or view it on GitHubhttps://github.com/nodejs/node-gyp/issues/629#issuecomment-146321928.
@dlong500 The Express 2015 licensing doesn't appear to have the same verbiage regarding large organizations and whatnot. See the following links to license terms for more info:
There is also this licensing whitepaper that has some additional info:
http://www.microsoft.com/en-us/download/details.aspx?id=13350
That said... I'm an engineer, not a lawyer... so I can't do any more than post links to content that's already freely available. :smiley:
+1 to seeing this situation get better, I just lost a night to troubleshooting this but now having found this thread have a lot more to try. thanks everyone for work and sharing so far.
@dlong500, this has been confirmed by a member of the legal team at Microsoft: there’s no enterprise usage limitation in the VS Express EULA.
@orangemocha, thanks for clarification of VS Express EULA. So, I have tried VS Express 2015 and it's working ok on new virtual machine. Config which I was using: Windows 10, Visual Studio Express 2015 for desktop, Windows 10 SDK, nodejs 4.1.2, node-gyp 3.0.3, python 2.7.10, git 2.6.1.
I have added env. variable GYP_MSVS_VERSION=2015 and then executed npm config set msvs_version=2015.
Note: installing SDK is not optional; without it, compilation will fail with error Could not load the Visual C++ component "VCBuild.exe".
@orangemocha yes, thanks for the info. The ideal solution would be a minimal build-tools package from Microsoft, but this is certainly a good workaround for now.
I am desperate now :-1:
I have reinstalled windows. Have now fresh Windows 7 + Windows 7.1 SDK + Latest Node and NPM + C++ Compiler for Python 2.7 and Python 2.7, but am getting myriads of errors on compile:
Example:
[email protected] install c:\Projects\test\node_modules\bufferutil
> node-gyp rebuild
c:\Projects\test\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\Tomi\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
bufferutil.cc
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(336): error C2988: unrecognizable template declaration/definition [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(336): error C2059: syntax error : 'using' [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(469): error C2988: unrecognizable template declaration/definition [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(469): error C2059: syntax error : 'using' [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(472): error C2332: 'enum' : missing tag name [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(472): error C3306: 'v8::<unnamed-tag>': unnamed class template is not allowed [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(472): error C2236: unexpected 'class' 'v8::WeakCallbackType'. Did you forget a ';'? [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(472): error C3381: 'v8::WeakCallbackType' : assembly access specifiers are only available in code compiled with a /clr option [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(576): error C2061: syntax error : identifier 'WeakCallbackType' [c:\Projects\test\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\Tomi\.node-gyp\4.2.0\include\node\v8.h(642) : see reference to class template instantiation 'v8::PersistentBase<T>' being compiled
Any idea? Thanks!
@tomitrescak It looks like Visual Studio Express 2015 for desktop (or VS Community) is the only way to get the C/C++ build tools
I'd love to ditch windows on my development pc, and just use ubuntu for everything. So I have a (possibly dumb) question: Is it at all possible to build the .node native extensions for windows, using a linux machine?
One way of dev life is to bash MS/VS/Windows on GitHub every possible chance you get and achieve nothing but more spite. The other approach is to report the issue where it belong:http://blogs.msdn.com/b/visualstudio/archive/2015/10/08/visual-studio-2015-update-1-ctp.aspx#10647152 or on Microsoft Connect etc., which will definitely make a real impact. Point being, instead of getting desperate yourself, give THEM the bug and get the tech improved for the welfare of future of tech and mankind!
@jasonwilliams200OK . That's not very helpful. Rest assured that many people on this thread have tried to go the official routes with MS. We have jobs to do, and are simply looking for practical solutions to these problems that wont take months (or worse).
@bgSosh, yes exactly trolling is not helpful, but reporting the issue where it belongs definitely is. Besides, this is not a today's problem and specific to node.js runtime. People are asking for independent buildtools for many years, way before the existence of node.js and even v8. So if it is going to happen in few "months", then it would be a great deal. But I am not crossing my fingers for months timeline just yet, unless we hear about some concrete plan.
Is it at all possible to build the .node native extensions for windows, using a linux machine?
Not at the moment but it might be once clang++ / clang-cl gets ABI-compatible enough with MSVS. It's possible 3.7 is already good enough for everyday use but I haven't tested that.
@bnoordhuis - Thank you! I'll check it out.
I just had the problem again with this command:
d:tmp> npm install mongoose --save
This fixed it:
C:tmp4> set PATH=C:WindowsMicrosoft.NETFramework64v4.0.30319;C:WindowsMicrosoft.NETFrameworkv4.0.30319;%PATH%
I came into this problem using ionic, and in it's docs http://ionicframework.com/docs/guide/installation.html, it recommends:
If you are on Windows, make sure to download and install Git for Windows and optionally Console2. You will be executing any commands in this guide in the Git Bash or Console2 windows.
12GB. Do I have to download 12GB of Microsoft garbage (and then some) to contribute 20 lines of code to a Javascript project?
2 days - do I have to waste 2 days to contribute 10 minutes of work?
Microsoft - do I really have to plague my PC with MS stuff to contribute to a project using Node?
This all makes sense, does it not? "Windows users are not happy" is an euphemistic understatement.
do I really have to plague my PC with MS stuff..
Sounds like you are using Unix-like operating system, then you don't need VS tooling at all to build the "node.js project only the one with native module".
Jason: no, I'm using Windows (long story), but still I get the chicken pox anytime I touch any of their "development tools"... I would have been OK with a few GBs of this garbage that I can just ditch the moment my pull req. gets approved - but having to wait hours to just get another myriad of error messages is not even half funny, and even would not be half funny with the Benny Hills theme looped all the way.
First - if you have vs2015 but did a "typical" install (which does not install c++ stuff), you can install the c++ stuff by going File > New Project and trying to start a c++ project. You will get options to install things. Make sure you have a couple gb on your hard disk.
Second - I think there's lots of confusion overall. Can someone involved with node-gyp write up a blog post summarizing what the problem actually is? Things I'd like to see addressed
I'm largely a javascript and .net developer. I've had some experience with a half dozen other languages including Erlang, Ruby, Java, and others, but never anything serious with Python or C++ which is why this entire conversation is a mystery to me. In fact, any time I try to do anything on linux I generally start hitting c++ dependency walls.
I'd really like to understand the underlying issues that are causing problems on Windows. I think we could bring a lot more brainpower to this if the issues were more clear.
@togakangaroo
I agree that a blog post detailing the issues at hand could be useful, but a little bit of research can answer all of your questions.
What exactly is the service that node-gyp provides that sooo many projects depend on?
It provides the ability to pull in natively compiled modules in to be accessible to Node.js. I.e. build C++ projects so you can use them in js.
Why on earth is a c++ compiler even necessary? Hardly anything else on windows requires a c++ compiler after all.
Because it is building native code, i.e. C++, which is super easy to do on non-Windows platforms with gcc or clang.
Why can't we just download a compiler as part of node on windows? Or as part of the first node-gyp install?
Just downloading a stand-alone compiler is one of the things that the multiple Microsoft employee posts in this thread have talked about, it is not easy to do, and less easy since they have removed the basic compiler from the latest versions of the Windows SDK.
What's the deal with the various configurations (an env variable and an npm variable? why?)
Because building c++ outside of a sandbox has many, many configurations and relies on envars that can drastically affect what is build.
How is it that there is such a large range of things that might go wrong? It would seem like there would be just two or three things but there seems to be endless combinations.
Welcome to compiling native code on a complex platform.
What does any of this have to do with Python? What is python even being used for?
Python is used internally by GYP, the CMake-like build system that node-gyp wraps and makes easier to use for node.
Why is it a version of Python that was superseded over seven years ago?
The reason python2 is required is because GYP requires it and hasn't converted to using python3. It isn't a simple switch to take a large project that many other projects depend on and change from Python 2 to 3, and so far, it doesn't seem like a large effort has been made to make that change, considering it is a low priority defect since 2009, https://code.google.com/p/gyp/issues/detail?id=36
What about all this is easier on a *nix system than on Windows?
*nix systems are a lot less complicated, you can very easily pull all your requirements (like gcc, python2, platform specific SDKS) and build and go, but on Windows, the ecosystem is a lot different, and it just isn't that simple, though many efforts, npm included, have tried to help this a ton, but there is still a lot of legacy work out there, and not enough time, money, and resources to turn it on overnight
Damn @dekarguy. That's a great explanation! I'll link this in the original question. THAAAAAAANKS :)
Why on earth is a c++ compiler even necessary?
For distribution, it is developer's choice whether they require end terminal to have C/C++ compilers available. For example in node-sass, we prebuild binaries and serve them from GitHub release assets. That is a too much work for repo maintainers; as for every module version (which roughly changes with every major version of node and used to change with every minor version before), there needs to be a different binary. This requirement is imposed by node.js runtime and there exist proposals to make the overall situation better (https://github.com/nodejs/node-gyp/issues/629#issuecomment-105072235).
Then we have different architectures and OSes. So the equation looks like <number of OSes to support> x <number of architectures to support> x <number of module versions to support>. There exist solutions like node-pre-gyp to automate this process. However, in node-sass we use a custom recipe to leverage AppVeyor CI to build binaries for Windows and store them as build artifacts. Hence as package devs, we don't even need a windows machine, we just download all combinations of windows binaries from AppVeyor once the release build succeeds. :)
Moreover, we backup our binaries in a separate repo: https://github.com/sass/node-sass-binaries. So we have 14 binaries for Windows, 14 for Linux, 14 FreeBSD and 7 (universal binaries) for OS X per release. And we will incorporate ARM at some point (and there is a news that MIPS is regaining popularity?). Anyhow, as a fallback (if the binary is not compatible for some astoundingly evil reason), then we do require C[++] compilers on end terminal.
Unless we have some kind of de facto solution/service for building and serving binaries (supporting BSDs and Solaris etc. obscure OSes and multi-architectures including ARM too), every npm package maintainer with native modules would either:
or
It could be offtopic but...
I had the problem because I had two instances of npm installed.
Command where npm returned two different directorties. So I removed the topmost and ran npm i -g node-gyp or for example npm i -g browser-sync.
@am11 so what I don't understand is - that unlike linux, I cannot think of a single piece of windows software outside of node that requires compiling from source. This includes many open source cross-platform pieces of software. This includes packages that I myself maintain over nuget. I understand that those authors simply offer a pre-built executable but there isn't this matrix problem that you describe. There's at most 2 versions x86 and x64 and the former usually works fine.
So why is it that node and specifically node package maintainers insist on compiling from source? As you say, node-sass seems to do this. What is it about node that requires re-compilation with every single node version bump? How is this unlike nearly every other piece of windows programming?
@bgSosh forgive my C-ignorance. so does that bascially mean that the interop happens within the c program itself and not by just shelling out to an exe?
If that's the case, then in theory this would be easily solved by having anything that could possibly be accomplished by shelling out to an executable (node-sass is a great example) do so, right?
I'm just trying to understand. If the latter is true then there might be a class of dependencies that could potentially have node-gyp removed as a sub-dependency/
@togakangaroo - I deleted my answer just after I posted it, as I'm far from an expert myself in this, and thought it would be better answered by someone more knowledgeable.
@togakangaroo, the recompilation is required on all OSes. When the module version (which we can get from NODE_MODULE_VERSION in C or node -p process.version.modules in CLI) changes, it signifies the breaking change and loses the binary compatibility with the pervious version. I do not know exactly what needs to be done in order to bring about version to version binary compatibility but with foreign function interface (FFI) or stable ABI contract with v8, it seems like the situation may get better.
To this mix, v8 version changes (which I think is the main source of this breakage) also influence compatibility across node.js runtime versions. This disparity is abstracted away with nan for native module devs (so devs do not have to keep adding #ifdefs in their code for each function signatures etc. change; when v8 guys decide to refactor some public interface).
Some information about this behaviour can be found in node.js docs: https://github.com/nodejs/node/blob/6fff47f/doc/releases.md#4-update-srcnode_versionh.
Folks over at node.js and libuv IRC channels and @kkoopa (who have done tremendous work on nan to keep us going) helped me understand all this, once upon a time. :)
Hey all, in case you missed it... :smiley:
Visual C++ Build Tools 2015 (Pre-release). If you want to build your C++ projects targeting Windows desktop without having Visual Studio installed on your computer, Microsoft Visual C++ Build Tools 2015 provides the required tools: C++ compilers, libraries, build scripts, Windows SDKs. This Community Technology Preview ships with the same C++ compilers and libraries packaged with Visual Studio 2015 Update 1 RC (2015.1).
http://blogs.msdn.com/b/vcblog/archive/2015/10/29/visual-studio-2015-update-1-rc-available.aspx
The config steps with Node.js should now be as follows:
:bulb: [Windows 7 only] requires .NET Framework 4.5.1
- Install Python 2.7, and add it to your
PATH,npm config set python python2.7- Launch cmd,
npm config set msvs_version 2015 --global(this is instead ofnpm install [package name] --msvs_version=2015every time.)- _SO MUCH npm install_ :tada:
So please give it a spin and send feedback if you're still running into issues or you think any crucial bits are missing. Much thanks to the VC team for pulling this off!! :smiley: +@mluparu
I've tested it with Node.js and many of the most popular / representative packages. This includes the following packages, as suggested by @am11.
Note that there are still many other things that can go wrong when dealing with native modules - e.g. platform and compiler differences, incompatibilities with architecture, Node version, missing prerequisites (and unfortunately most packages don't provide the best indication of how and where to get those prereqs). One tool that's very helpful in debugging missing prerequisites on Windows is Dependency Walker.
BTW I'll be in SF next week giving a talk on Node.js + Windows, so definitely swing by if you're in the area, and want to chat further: https://www.eventbrite.com/e/nodejs-and-npm-for-the-windows-developer-tickets-19280683042
@mousetraps Is it working on both node.js branches - 0.xx.x and 4.x.x? Which npm versions are tested?
Thank for the update @mousetraps! This is really an excellent news. I actually skimmed through that blog post, but somehow skipped the last bit. :smile:
With VS2015 Update 1 RTM, I hope we will get an ISO for offline installation which we would be able to consume with Windows Nano Server and docker containers etc. :)
Currently, from the link you provided, when I downloaded VisualCppBuildTools_Full.exe and ran VisualCppBuildTools_Full.exe /layout (with the download-only switch) from cmd, first it complained the default save path has invalid ++ characters, so I changed it to c:\temp\blah, then it downloaded 1.38 GBs; which is large but comparatively much better than the VS installation.
@Sogl, per my understanding, if it compiles the package under question with one version of node.js, it should compile with all the versions that the package supports (the package maintainers need to keep their native binding up-to-date by depending on latest versions of node-gyp and nan, which sometimes takes code changes rather than mere version update).
@fuczak i can't install it at-all.. even without the VS2015 installed. Launcher just shows the splash-screen and then dies.. sometimes Win10 wants to investigate the issue but then recommends to close the installer
@spawn-guy can you send the install logs? Run vscollect.exe from http://aka.ms/vscollect and share the %TEMP%vslogs.zip, sharing it on OneDrive preferred.
Thanks!
then it downloaded 1.38 GBs; which is large but comparatively much better than the VS installation.
OMG. It would be better to give us a link to iso-image. Not all of us have a good Internet connection.
@mousetraps Thank you very much! All works fine with node 4.
My env:
Windows 7 x64
node 4.2.2
npm 3.3.12
Just tested with browser-sync and node-sass.
@mousetraps, It's working, thank you.
@mousetraps Works like a charm! Thanks you very much.
I spent hours to figure out this problem and I'm sure you saved me many hours of investigation.
My env:
Windows 7 x64
node 5.0.0
npm 3.3.6
Tested with npm install:
phantomjs
browser-sync
node-sass
My experience of trying to use node.js on Windows 10, after following all the directions I can including those in this thread, is just a pounding, unrelenting hailstorm of errors.
I have given up for now.
If Microsoft wants node.js to be part of its ecosystem it's going to need to do far reaching and comprehensive QA and simulate typical user scenarios.
Right now node.js on Windows is just a huge time waste. node.js on Windows game over until someone fixes alot of stuff.
error logs here:
@dukedougal in this case, I'd expect the same issue to occur on any platform. In particular, you're trying to install [email protected], which is incompatible with your current version of Node.js. You can tell because the errors involve syntax errors related to nan and the like. The most recent version of node-sass (currently 3.4.1) should work fine with the latest releases of Node.js.
Thanks @am11 and @Sogl for the feedback on ISO distribution and the /layout flag! The VC team is looking into both issues.
@mousetraps I appreciate your help very much thank you.
Without heroic people such as @mousetraps actually solving these insane problems then the game would just be over.
If I'm using the wrong version of something then I shouldn't be hit with a wave of cryptic compiler errors.
I agree. There is also literally no way to accurately tell this, as far as I can tell, and from what I've learned from others. :/
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v140 to build using the v140 build tools. [C:COMPANYDATAWEBPublicBMAZPREP-BM-1.4.0_20151106T0945node_modulesxslt4nodenode_modulesjavabuildnodejavabridge_bindings.vcxproj]
While trying to npm install a new update, I got the above. Following this thread, I downloaded the RC from @mousetraps above, but when I to uninstall, it fails saying blocked (even tried to reboot just in case it was a previous install issue). Below is the last bit of the log file which I suspect has the answer (looks like it's saying either I need to have something else installed, making me wonder what the point was) or like one of the required downloads is failing during setup.
Any suggestions?
[042C:03C8][2015-11-06T11:12:06]i000: MUX: Setup update feature is enabled. Evaluating conditions to determine whether to run setup update.
[042C:03C8][2015-11-06T11:12:06]i000: MUX: Checking http://go.microsoft.com/fwlink/?LinkID=606891 for update.
[042C:03C8][2015-11-06T11:12:08]i000: MUX: Failed to download the update xml file from http://go.microsoft.com/fwlink/?LinkID=606891 Setup will not be updated.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition 'NOT (CurrentOperation = "Uninstall")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i052: Condition '(CurrentOperation = "Install") OR (CurrentOperation = "Repair")' evaluates to true.
[042C:03C8][2015-11-06T11:12:08]i000: MUX: Stop Block: NoApplicableUpdates : Update 1 RC does not apply, or is blocked by another condition on your computer.
[042C:03C8][2015-11-06T11:12:08]i000: MUX: Detect Completed
[042C:03C8][2015-11-06T11:12:08]i000: MUX: Wait for View to be loaded
[042C:10A0][2015-11-06T11:12:08]i000: MUX: Detect Completed, now create view
[042C:03C8][2015-11-06T11:12:09]i000: MUX: View loaded
[042C:03C8][2015-11-06T11:12:09]i000: MUX: Stop Block: NoApplicableUpdates : Update 1 RC does not apply, or is blocked by another condition on your computer.
[042C:03C8][2015-11-06T11:12:09]i000: MUX: Go to Blocker page.
[042C:03C8][2015-11-06T11:12:09]i199: Detect complete, result: 0x0
@dukedougal, I agree with @mousetraps; yours is not a Windows-only issue. node-sass v0.9.6 is not supported for node.js v5 on any platform. During this one year period, we experienced eight node.js module versions updates. In fact, the first version that supported io.js (aka node.js v1.x) was node-sass v2.0.0. Please update to latest version of node-sass (v3.4.1) in order to get more runtime versions support, tons of features in node-sass itself as well as the best Sass language v3x support till date via latest libsass. :)
Since we cannot provide a forward compatible binary due to process.versions.modules changes with current infrastructure of node.js C++ modules, therefore, we fallback to manual build if the suitable readymade binary is not found. v2+ of node-sass was the first to provide the proper fallback to "compile at install-time" mechanism for the new/unknown version of node.js. Unfortunately, that functionality was never backported to node-sass v0x and v1x branches (mostly due to the entire rewrite of binding layer and overall divergence, sprinkled with some procrastination and lack of majority consumers' interest in older version; as 0.9.6 corresponds to obsolete version of libsass so there is no point to invest time there).
Whenever you encounter such a problem, you can always search existing issues in node-sass issue tracker and file a new one if it wasn't reported before. We also have channel on gitter and slack.
@mousetraps, thank you! With this pace, I am sure the higher consumer satisfaction level will be achieved pretty swiftly. :)
@am11 how do even update to the latest node-sass? I haven't made any decisions along the way to even install it. I had thought it was controlled by package.json files or something? If I install it, won't I get node.js applications complaining because they want an earlier version?
Again I appreciate the help but when the answer to the question "why isn't it working?" is a long technical explanation, there is a reasonable question to ask about whether the ecosystem architecture is sound. Things should just work.
@dukedougal, the node-sass API also changed between v0.9.6 and v3.4.1. You are right, you cannot just update the node-sass version in C:\Users\username\devel\rubix\package.json and expect it to work right away. You will need to make the call sites to comply with node-sass API changes in your code (or if you are dependent on some node-sass downstream such as gulp-sass or grunt-sass, you will need to upgrade its version and save yourself from updating code every time node-sass API changes).
This is a sad fact of life, but I am sure you will find sufficient help from node-sass readme and existing issues to get your project upgraded against latest version of node-sass.
@dukedougal @Fishrock123 I agree that Windows or not, the user experience with native module compilation is pretty non-ideal, and luckily there are folks who are making steps towards a better experience with efforts like https://github.com/nodejs/build/issues/151
FWIW while testing the VC++ Build Tools, I wrote a script that runs through a large set of native modules in the npm registry, tries to build them, and saves some info about them like stdout, stderr, etc. (haven't gotten the chance to push the script / results to GH yet, but I'll post here when I do). After running through the script, I started noticing some patterns, have begun establishing common classes of errors, and am working on translating those errors into a more human and actionable language. Granted, it won't be perfect or precise, but hopefully we can use the results of that to provide more actionable resolution recommendations so that people aren't left wading through cryptic compiler errors.
@mousetraps That sounds like very valuable efforts that will be greatly appreciated at a human level. I love Node.js (LONG time MS shop and came over from .net early 2014) and for the most part, it's an absolute pleasure to work with, but many of these (of MS specific issues) leave me scared I've taken multiple companies in the wrong direction because of something as simple as an error that provides no information and NPM installs are nearly always the source and from there, it seems nearly always a node-gyp compilation issue so work that that and what this thread addresses, stands to make the entire node.js experience substantially better and less frightening :)
@rainabba I'm just visiting from the Linux world and it was there that I established my belief that node.js has a major problem with versioning, builds and incompatibility. node.js is a very long way from sunshine and lollipops on non-Windows platforms.
@mousetraps I followed your solution provided in this comment to the letter but now when I try npm install mongoose, I get the following error:
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 )
Traceback (most recent call last):
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 15, in <module>
import gyp
ImportError: No module named gyp
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:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dev\Pluralsight\Web Development with ExpressJS\node_modules\kerberos
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
I've tried re-installing node, putting it in a directory other than Program Files (to avoid a folder name with a space), updating npm, it always gives the same error. Searching for the error isn't particularly helpful because all the solutions given are how to fix a V8 build.
Edit: I tried out @Sogl 's solution outlined here and I get the same error, no module named gyp.
I've even tried updating the gyp folder that throws the error using git clone (outlined here) and modifying the source code of gyp_main.py directly (outlined here), but the error remains.
This is incredibly infuriating because I had this node-gyp error fixed for a few months until the problem resurfaced yesterday.
@mousetraps Thank you! It works and makes things so much easier.
Tested on Windows 10 x64, Node.js 5.0.0 x64, npm 3.3.6
Successfully installed latest versions of:
utf-8-validate
node-sass
phantomjs
bufferutil
+1000000000000000000000000000000000000
+1
I have Nodejs 5.0.0 x64, npm 3.3.6 and Win 8.1 x64. Should I try going with Win 10? I already tried lost of possible combiantions of VS, Python & node to make this work. But I obviously never succeeded...
Hi. Installed the Build Tools 2015 provided by @mousetraps, followed instructions, tried to install selenium-webdriver (node-gyp dependant) and got the error below. Any ideas? (nodejs 4.2.2, npm 3.4, windows 10x64)
Thank you!
C:UsersrickmAppDataRoamingnpmnode_modulesselenium-webdrivernode_modulesutf-8-validate>if not defined npm_config_node_gyp (node "C:UsersrickmAppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number. [C:UsersrickmAppDataRoamingnpmnode_modulesselenium-webdrivernode_modulesutf-8-validatebuildvalidat
ion.vcxproj]
validation.cc
c:usersrickm.node-gyp4.2.2includenodeuv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No
such file or directory [C:UsersrickmAppDataRoamingnpmnode_modulesselenium-webdrivernode_modulesutf-8-validate
buildvalidation.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:UsersrickmAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibbuild.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:Program Filesnodejsnode.exe" "C:UsersrickmAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd C:UsersrickmAppDataRoamingnpmnode_modulesselenium-webdrivernode_modulesutf-8-validate
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
Update: I've gotten @mousetraps 's solution here to work on fresh installs of Windows 7 and 8.1 (both 64-bit machines). If you use node v5.0.0, it already comes with npm v3.3.6, which means you don't need to update npm.
@ricmed205 try to update to the latest npm. If does not help try the latest Node.js
I have tested selenium-webdriver. Should be installing fine.
I try @mousetraps 's solution with windows 10 64 bit . Node 0.10.25 , npm 1.3.5 . but it not work
@phthong
but it not work
What didn't work? Which package is failing for you? What is the error you are getting?
@ricmed205, I tried installing selenium-webdriver with node.js 5 and it went well. According to google results, the error you are getting (_Cannot open include file: 'winsock2.h'_) suggests that Windows SDK is not installed or not picking up. I would make sure C:\Program Files (x86)\Microsoft SDKs\Windows Kits and/or C:\Program Files (x86)\Microsoft SDKs\Windows exist and then in cmd issue SET PATH=C:\Program Files (x86)\MSBuild\14.0\BIN;%PATH% followed by npm install selenium-webdriver.
@jasonwilliams200OK @igorpupkinable I tried with latest nodejs (5), npm (3.4) and windows10x64 with your instructions without luck. I get the same error. I checked that I have installed the windows 10 SDKs. I think the key is this:
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry.
but I don't know how to fix it.
Thank you!
@ricmed205, what do you see in the following locations:
@jasonwilliams200OK
I don't have C:Program Files (x86)Microsoft SDKsWindows.
I have C:Program Files (x86)Microsoft SDKsWindows Kits10ExtensionSDKs 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 Kits10Include10.0.10240.0um"
@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:
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)nodejsnode_modulesnpmnode_modulesnode-gypgypgyp_main.py", line 18, in
sys.exit(gyp.script_main())
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgyp__init__.py", line 534, in script_main
return main(sys.argv[1:])
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgyp__init__.py", line 527, in main
return gyp_main(args)
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgyp__init__.py", line 503, in gyp_main
options.circular_check)
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgyp__init__.py", line 98, in Load
generator.CalculateVariables(default_variables, params)
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgypgeneratormsvs.py", line 1798, in CalculateVariables
generator_flags.get('msvs_version', 'auto'))
File "C:Program Files (x86)nodejsnode_modulesnpmnode_modulesnode-gypgyppylibgypMSVSVersion.py", line 400, 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 (x86)nodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.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)nodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd D:ProjectGooddatatestgdc-clientnode_modulesgrunt-gd-spriternode_modulesnode-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)nodejsnode_modulesnpmbinnpm-cli.js" "install"
npm ERR! cwd D:ProjectGooddatatestgdc-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:
@nodejs/documentation do you think we should make an official guide about this?
@mousetraps are the setup instructions you advise in https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245 a preferred way to setup node? Should we send a PR to the README to update the setup instructions?
@TheAlphaNerd I for one would certainly appreciate some definitive, documented answers (or at least acknowledgements) to the many difficulties of node-gyp. Calling out some of the difficulties explicitly might even produce some solutions or at least be useful to future projects with similar aspirations.
I submitted a series of questions above that @dekarguy has partially answered. I'd really love some in-depth discussion of these.
hey @togakangaroo
so node is actually built using a whole bunch of stuff.
The source is a combination of C++ and JavaScript, with bindings in between the two. The two main libraries used in C++ land a libuv and v8.
libuv is used for doing asynchronus I/O including but not limited to TCP / UDP (web traffic), DNS resolution, and File system events (and a WHOLE BUNCH OF OTHER STUFF).
v8 is a JavaScript engine which is used to execute the JavaScript given to node, I believe it is also used to a degree with memory management but I am not super familiar with it yet.
There are things that are exposes in v8 and in libuv that are not exposed in javascript land. For example the bits you need to do serial port communication. There are also performance benefits in some cases, or native libraries already built in c / c++ that can be wrapped.
Hopefully that helps to answer some of the questions regarding c++. you should start a question in http://github.com/nodejs/help and @ me if you want to talk some more about it, or chat about the python build tool stack
@nodejs/documentation do you think we should make an official guide about this?
I think it would definitely make sense to have some form of this in some form of official docs. It may make sense for it to live here https://nodejs.org/en/download/package-manager/#windows or at least be referenced there, since nearly everyone using Node.js on Windows needs to build a native addon at some point.
Yup I think something in the readme and a reference there on the website
Definitely would +1 seeing a "How Shit Actually Works" article. The one thing I see among Javascript developers is a completely lapse in understanding of what Javascript is and how it's handled under the hood. Many developers don't know what bindings are, how compilation works, what the difference between a scripting/systems language is, etc.
I think a lot of people are asking questions when they don't have even a basic understanding of how the whole ecosystem works - not their fault, but it's hard to understand how not-straightforward-or-trivial it is.
@Qix- how are you supposed to learn if you don't ask questions?
@TheAlphaNerd That wasn't my point (I know I worded it weird). My point is a lot of the same questions are being asked _because_ they don't have a basic understanding of the internals. It isn't their fault, but a lot of the questions I see about compilation stem from not knowing how the compilation system works. The fact MSVC is incredibly convoluted and requires a just-right environment doesn't help, either. That's why the terms "easy" gets thrown around for Unix tools because there is little environment setup necessary.
A guide explaining, even at a mid to high level, what gyp is, what it wraps, and what the underlying build system it wraps itself wraps, and what those underlying tools do (compiler/linker/etc.) and even going so far as explaining terminology behind common error messages, etc.
Once people start understanding the concepts of native development, I think we'll see a drop in questions, issues, and frustration, and a rise in quality within the native modules that do exist.
I totally agree with your sentiment.
Maybe if you make an issue over at https://github.com/nodejs/evangelism/issues someone might choose to put some time in. I agree it would be very meaningful.
One other thing I'd like to point out; a vast amount of users of Node.js come from a web background. Node.js is the epitome of the melding between native and web technologies. Gyp is seen as "the problem" when a lot of the times it's the build configuration within the modules is to blame - or, code is written but not tested (yes, web people, native code _does actually need_ to be tested on _each_ platform before it's considered "cross platform"!)
Things like that should be emphasized - the web world and the native world are enormously different.
@Qix- IMO, the developer typing npm install <package> shouldn't need to care if the package is native or not. This is a problem for the package manager to solve. Unfortunately, npm choose to ignore the real issue and put the burden on the developers.
@luisrudge that's in an ideal world, though. I would love to see that. My point of native code _requiring_ testing on different platforms still stands. Developers don't do this before pushing to NPM.
It's not NPM's job to fix that, and Gyp can only do so much to mitigate that. Javascript developers aren't end-users, they're developers. They should at least have a basic understanding of what is going on underneath their own applications, IMO.
@Qix-
that's in an ideal world, though. I would love to see that. My point of native code requiring testing on different platforms still stands. Developers don't do this before pushing to NPM. It's not NPM's job to fix that, and Gyp can only do so much to mitigate that.
Yes. The point stands. It should be tested, but my point is that node-gyp shouldn't even exist. npm should distribute the native packages itself and if it failed to build in a certain environment, don't allow developers with the same environment to download the package.
Javascript developers aren't end-users, they're developers. They should at least have a basic understanding of what is going on underneath their own applications, IMO.
Basic is a very subjective word. IMO, if I install node-saas, I know it converts saas to css. That's the understanding a developer has to have. I couldn't care less if it does with c++ bindings or javascript. Same thing with socket.io and other the other packages that depend on node-gyp.
npm should distribute the native packages itself
There is a lot of extra overhead on that. Windows users would have to have the right MSVCRT installed. And then you have to instruct users not to build in debug mode, because we all know they would (Why is this package crashing saying "Missing MSVCRTD120.dll"?). And then users of OSX would have to make sure the code worked for them (there are a lot of compilation differences between each version, especially as of late). And then Linux users would have to compile a version for many, many different flavors of linux.
It's not feasible. That would kill the native Node scene and reduce productivity. Unless, that is, NPM wants to create its own cross-platform compilation service that compiles your code for a butt-ton of platforms and versions. I'll let the NPM developers decide the feasibility of that. :+1:
That's the understanding a developer has to have. I couldn't care less if it does with c++ bindings or javascript.
You should, though. You should understand what's going on underneath. That kind of mentality is a direct influencer in continued security concerns and bloat within NPM modules.
That's not to say you should know exactly _how_ a library utilizes such technologies. That's a large part of the reason why you're using a library and not writing it yourself.
The point to understanding what's going on underneath is to know what an error message means and to know how to fix it. For instance, seeing that there is a syntax error in a released module indicates there is either a compiler version mismatch or that the original developer wrote code for a non-standard compiler/extension and to open a ticket only then. If it's a dependency issue, such as a missing library, you'd save yourself time by just installing the dependency yourself and _then_ opening a ticket with the solution to either include it in the bootstrapping step or to just include it as a requirement in the documentation.
Either way, the lack of understanding of basic native operations is what is fueling a lot of problems with Node and the Node suite (NPM, node-gyp, etc.) - Node is simply a small, cross platform Javascript environment that wraps POSIX or otherwise unix-y system calls in slightly higher level constructs. That's how it got popular, and now that web developers have caught on to its usefulness, the percentage of users that actually _understand_ the API's origins and how Node is structured (including what it actually does) is decreasing steadily.
But that's more off-topic than I think is appropriate for this thread.
By the way I like that node-gyp exists. I don't have to worry about configuring CMake or some other build system to build against Node and then make whatever a .node is - and then call those steps in a cross-platform manner in an install hook - for each of my repositories that uses native code. I don't personally prefer the style/manner that configuration files are formatted in, but that's purely taste. Node-gyp works well for what it does.
It's great to know that you know everything about node and how it's made and what it is from inside. But I don't care and I'm sure 95% of the developers that are not writing a node app don't care too. If it's hard for npm to do this for linux, because of the huge amount of distros, then fix this for windows users, since most of the issues related with node, on Windows, are related to this nonsense.
I'm not trying to turn it into a pissing match here. My point is that in order to solve problems you should understand what you're developing with. If an individual can't at least appreciate that, then I severely question their ability to write code, much less solve problems concerning cross-platform compatibility.
@Qix-, I made an accurate statement that most people are "just trolling" and blindly making comments without reading the thread. That was my observation.
If there is a specific problem related to topic (some X package is not installing on Windows vY given I have all the prerequisites installed), lets talk about it, find solution, feel "happy" about it and move on.
Keeping it "professional" means refraining oneself from being personal as well as sticking to the topic at hand (e.g. it makes zero sense to discuss cmake vs. gyp on this thread, especially when you have no idea what you are talking about).
Alright; I'm not going to cause drama with you.
The point is, there should be a resource that outlines how the build system for Node works. I think that's fairly agreed upon.
I agree with that :) Somewhere, somehow, we need better docs for this kinds of errors.
Using the standalone C++ build tools I can't get socket.io to build it keeps throwing this error:
$ npm install --save socket.io
npm WARN package.json @ No repository field.
npm WARN package.json @ No license field.
> [email protected] install D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
\
D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "D:\installs\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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
validation.cc
c:\users\mtpultz\.node-gyp\4.2.2\include\node\uv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory [D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules \utf-8-validate\build\validation.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 (D:\installs\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "D:\\installs\\nodejs\\node.exe" "D:\\installs\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.2.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
> [email protected] install D:\projects\nodejs\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
Any suggestions?
These kinds of errors are exactly what I'm talking about.
Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
There is the error. Hint: look for warning: or error:. Often times errors are accompanied by warnings that tell you what's really wrong.
Install the Windows SDK, or re-install MSVS.
@Qix- Why do I have to install MSVC when they just provided the C++ build tools and I have them installed with Python 2.7 and followed the instructions provided by @mousetraps, which seemed to work for some people, but maybe they weren't running Windows 10. I just want to compile not use their IDE or even go near .NET programming, which I know absolutely nothing about. I tried your other suggestion and downloaded and ran the Windows SDK and it said I was up to date already.
The solution I'm using now is just attaching the project to a virtualbox like Homestead in my case as I'm using Laravel + Redis + ExpressJS in this application, then just SSH in and run npm. Way less hassle then buggering around for hours downloading/installing/uninstalling/downloading/reinstalling/etc.
Sorry, should have read "MSVS" (MS Visual Studio). I haven't (yet) installed the independent build tools by Microsoft yet, but I wouldn't be surprised if they didn't include the SDK. Plus, seeing as how Windows 10 is fairly new I wouldn't be surprised if there was some other obscure error.
Did you download/install the Windows SDK? @mousetraps do the build tools include the windows SDK?
@mtpultz, we have a solution to the exact problem by @ricmed205 above:
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).
As @mousetraps mentioned that SDKs are included, here is the blog post http://blogs.msdn.com/b/vcblog/archive/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments.aspx which details on what is included and what is marked optional etc.
if you rerun the build tools setup and select both 8,1 and 10 SDKs, it will install the missing one.
Thanks @jasonwilliams200OK that did it.
@jasonwilliams200OK As mousetraps pointed here, latest nodejs is not needed (v0.x, v4, v5 works). I work with v4 myself.
@luisrudge I would add the following remarks in the fix summary:
Honestly, what really prevented/frightened me from using a node-gyp dependent module (after days frustrated with why I couldn't install selenium-webdriver, just as any other module, and researching/learning then what node-gyp was) was the size of the MSVS/Build Tools install. Why on earth would I need several GBs of code to work with at most MB size programs (JS scripts, nodejs, python, npm modules...). "Is python needed to work with sockets.io module? Mmm Ok, I'm not quite sure why this is the case, but, let's see: download/install~30MB? easy, let's do it. Next, download/install a Gbs thing. What?? I must be doing something wrong or there SHOULD be a better way somewhere else. Hell, photoshop/dreamweaver are ~1GB and the whole windows OS is ~15GB..."
Can someone explain why all those GBs are needed? Also, I see in the Build Tools: 800 MB of available hard disk space, but I got installed ~4.5Gbs? which I went an entire day downloading.
Sorry for the rant. Hopefully, the Q&A will supplement the docs to quickly/better explain the newbies like me and be more confident about the whole nodejs/windows experience.
So here it is. I have tested these steps multiple times on (each time) newly created Windows 7 SP1 VMs with IE8.
Scenario: I have a brand new Windows system, what to do?
- [Only if it is Windows 7 then and you don't already] Download .NET Framework 4.5.1 and run the installer.
- Download Build Tools 2015, run the installer, select
Custom, clickNextand check bothSDKs, clickNextand thenInstall.- Download and install latest node.js.
- Download and install Python 2.7.x.
- Open
cmdand runnpm config set msvs_version 2015 --global.
Hopefully it is a temporary registry fix and they will fix it before Build Tools get out of Technical Preview status. Out of 4 times it created that registry value once.
- Start > Run > cmd (and press Ctrl+Shift+Enter to _Run as Administrator_):
For 64-bit Windows
cmd
:: copy paste this command and press enter
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 /v 14.0 /t REG_EXPAND_SZ /d ^%programfiles(x86)^%"\Microsoft Visual Studio 14.0\\"
For 32-bit Windows
cmd
:: copy paste this command and press enter
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 /v 14.0 /t REG_EXPAND_SZ /d ^%programfiles^%"\Microsoft Visual Studio 14.0\\"
Now install the package like npm install selenium-webdriver and it should work!
My installation is not brand new, I had some related stuff installed and now I am getting
MSB4019orMSB8020.
This means somehow you have incorrect version of msbuild in PATH. To fix that, put C:\Program Files (x86)\MSBuild\14.0\Bin; at the beginning of PATH under System Environment Variables. To do it quickly (without making permanent change), run SET PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH% in command prompt in case of 64-bit Windows or %ProgramFiles%\MSBuild\14.0\Bin; in case of 32-bit Windows. Then run your intended npm install command.
Finally, what to expect?
Expect every package which requires C/C++ code compilation at the time of installation to succeed on Windows, exactly as they compile at installation time on Unix-like operating systems, _except_ those which are not supporting Windows _at all_ (yet?) such as node-gd. For such packages, you can find their repository URL on package's http://npmjs.org/ page and find the Windows support status in their issue tracker.
@ricmed205, I know the latest version of node.js is not a requirement here, but if you are to install right _now_, fetch the latest instead of some old one. Otherwise it should work on all supported (by package) versions of node.js (and conversely v8 and whatnot).
@jasonwilliams200OK
Hopefully it is a temporary registry fix
Perhaps even a default .reg file for the C: drive would be useful instead of having people mess with their registries? Just a thought. Good writeup, though!
Should there be an optional way to distribute native modules that don't involve a prebuild script? And any sane module will state what it depends on, if it isn't preinstalled. Most native modules do that already.
Highly frustrating stuff. node-gyp is unable to find the header files from cpp.
@rishantagarwal you'll be hard-pressed to find a build system that can do that reliably and efficiently. That's not node-gyp's fault.
@jasonwilliams200OK ,
I think
Open cmd and run npm config msvs_version 2015 --global.
should actually be
Open cmd and run npm config set msvs_version 2015 --global.
@teobugslayer, you are right, fixed above.
@jasonwilliams200OK did you try a REG_EXPAND_SZ registry key type w/ %programfiles(x86)%? That could allow skipping the explanation about c:. Also instead of manually doing it with regedit, this instruction could probably be restated with a 1 line reg command.
@fredericosilva, good idea, updated.
4 days trying only to do a npm install. Download more than 6gb. Thank you Windows and everything else for this waste of time,
Yet with these errors
@lehno We all understand the frustration some people are having, but as evidenced by this thread there are clearly many people working to make the Node ecosystem better for Windows. Why not keep things on a more positive note and support those who are spending a lot of time trying to make things better for other people? The Microsoft build tools situation is something that has been beaten to death many times over at this point.
Why on earth would I need several GBs of code to work with at most MB size programs (JS scripts, nodejs, python, npm modules...).
Several GB of stuff is to compile C/C++ code (using C/C++ compilers and SDKs).
Python is required for gyp (the underlying C/C++ build system technology for node-gyp).
This is _not_ for _any_ npm package which relies on pure JavaScript code but _only_ those which are known as "npm packages with native or C/C++ modules".
It's Generalization vs. Specialization; keeping things in proportion makes it easier to improve science and technology!
I think the number of steps needed to setup the build environment or the size of it should not be addressed here because it's simply nothing that node-gyp can change. Please don't misunderstand the title as an invitation to rant about windows here. It just bloats this thread and leads to nothing. If you still have problems following the mentioned steps you can ask for help here. @jasonwilliams200OK you are doing a great job btw.
Registry keys often get messed up when there are multiple versions, or some incomplete versions installed. In such cases using VS native tools command prompt usually works since it sets correct environment variables using C:\Program Files (x86)\Microsoft Visual Studio <version>\VC\vcvarsall.bat
Would it be possible for node-gyp to call this files before starting gyp?
In cases when this file can not be found, error report from node-gyp about not being able to find sdk at the expected path, would be much easier to understand and resolve than "C:\Microsoft.Cpp.Default.props" not found errors from the compiler.
@nightwing, I agree with you, generally this is how it is. However, in this case vcvarsall.bat is throwing error from a more internal script (VC\bin\vcvars32.bat) which tries to deduce to version from the very registry key. The line of code which is setting registry in the aforementioned steps are exactly fixing that for Build Tools 2015 and that is exactly what it looks like when we install full VS.
Also note that gyp calls vcvarsall.bat for us, so we don't have to call it explicitly or use Visual Studio Command Prompt.
This is a build tools bug in Technical Preview stage. We can expect it to fix by RTM (which I think might be aligned with VS2015 Update 1 release on 30th Nov. 2015).
Thank you, @mousetraps - your comment helped, node-gyp works now on Windows 7-x64. Before installing VC++ _Build Tools Technical Preview Additionally_, I had to install _MS Visual Studio 2015 Express with custom installation Windows 8.1 SDK checked_, but I don't know, if this is necessary for others. Also I had to manually install the latest npm version:
npm install -g npm
npm cache clean
And I had to globally install the latest version of node-gyp:
npm install node-gyp@latest -g
Now I have this working environment without any node-gyp errors, if i do npm install:
Windows 7-x64
node 4.2.2-x64
python 2.7.10-x64
npm 3.4.1
node-gyp 3.1.0
If you have trouble with this messages:
“warning MSB8003: Could not find WindowsSDKDir variable from the registry.TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.”
The problem may occurs even if you had installed windows sdk, or Visual C++ Build Tools 2015 (Pre-release) has been installed. I had spend almost 3 days. :(
Here comes the resolution:
{
'target_defaults': {
'type': 'loadable_module',
'win_delay_load_hook': 'true',
'product_prefix': '',
'include_dirs': [
'<(node_root_dir)/include/node',
'<(node_root_dir)/src',
'<(node_root_dir)/deps/uv/include',
'<(node_root_dir)/deps/v8/include',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/um',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/shared',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt',
'C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/winrt'
],
……
The warning message still there. But all the windows headers need by the package you are building will be found.
@mousetraps
@jianglinchun, this is due to the fact that in Windows 10, the SDK location has been changed and the upstream gyp (http://code.google.com/p/gyp/) has yet to address this.
Therefore, the current (bit non-hacky) recommendation is to select both Windows 8.1 and Windows 10 SDKs when installing Build Tools 2015. This way the software perhaps actually builds against Windows 8.1 SDK on Windows 10.
See the related Universal CRT announcement here: http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx.
Thank you @jasonwilliams200OK. I do believe this problem will be solved. :)
If gentlyRm have an option not to nuking the package will help a lot. :)
So I'm thinking we should just update the README Installation instructions with @mousetraps' instructions in https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245, and then we can close this issue.
Hey @TooTallNate we have an issue open over on node/node
:smile:
@TooTallNate @TheAlphaNerd yep, it's coming... got caught up with other things this week was just a little too optimistic on my timeline for sending out a PR. :-/
@mousetraps What about iso-image with build tools?
@Sogl we're looking into ISOs for the RTM release. As far as I understand, there's no technical / strategic / legal reason we didn't release one... it's mostly that things have been pretty hectic around here gearing up for VSConnect and Update 1, and there were more critical things to focus on at that point in time.
Additionally, I had to install MS Visual Studio 2015 Express with Windows 8 SDK checked
@stevenpietzsch - interesting... did you try selecting the windows 8.1 SDK in the build tools installer?
@jianglinchun, this is due to the fact that in Windows 10, the SDK location has been changed and the upstream gyp (http://code.google.com/p/gyp/) has yet to address this.
Therefore, the current (bit non-hacky) recommendation is to select both Windows 8.1 and Windows 10 SDKs when installing Build Tools 2015. This way the software perhaps actually builds against Windows 8.1 SDK on Windows 10.
@jasonwilliams200OK - is there an issue open in gyp on this (can't find one)? Also a more minimal recommendation would be to select Windows 8.1 SDK on Windows 10, right? (which I _thought_ was the default in the c++ build tools anyways, which is why I didn't mention it in the original instructions, but maybe I was mistaken)
EDIT: Ahh, never mind... it appears that both are required for now... I didn't realize that the default install was actually different from the default options selected when you run through the installer.
Just as a humorous aside for anyone following this thread, if, like me you were curious about what node-gyp is, then without the least irony you will find it described here: https://github.com/nodejs/node-gyp like this:
node-gyp is a cross-platform command-line tool ..............takes away the pain of dealing with the various differences in build platforms.
Ahh... so painless...
Question for everyone who's configuration using the C++ Build Tools failed and they had to install Windows SDKs separately and whatnot...
How many of you chose to do the custom install? Was there anyone who ran into an issue after selecting the default install?
I've been trying to investigate some of these edge cases that people who were running into issues w/ the build SKU ran into so that I can update the instructions appropriately, and my hunch is that the custom install is where all of the issues are arising. The interesting thing about the build sku is that the default install does not do a full install. Rather, it installs a minimal set of dependencies from the Windows 8.1 and Windows 10 SDKs, and I've successfully been able to make things work using the default install of the Build Tools on Windows 7, Windows 8.1, and Windows 10.
@mousetraps, I always selected custom install. Will try with default installation option later. About the registry hack, is it also not required with default installation (or will it be fixed in RTM)?
@dukedougal You mean writing an impossible program? Building an impossible shape? Building a contradiction of the laws of the universe? You mean, this sentence is false? :stuck_out_tongue_winking_eye:
_(Thankfully, I normally use Linux, but I feel your pain - try learning anything .NET with a vested interest and find out the primary package manager, NuGet, is only just now considering porting to your OS.)_
@mousetraps my own recent failed attempts were using the custom installation as well, having selected both the Windows 10 and Windows 8.1 SDKs.
Curiously, running the C++ Build Tools installer again and selecting the "modify" action always displays the Windows 8.1 SDK as unselected. At this point the installer does not permit me to continue with the modification unless I check the Windows 8.1 SDK and/or uncheck the Windows 10 SDK. Checking the Windows 8.1 SDK indicates an additional 112 MB will be used, and in proceeding with the action the installer completes the "modification" in under a minute - however running the installer and choosing "modify" once again brings me back to where I started; the 8.1 SDK unchecked, and checking it apparently being interpreted as a modification to my Build Tools installation. This may simply be a misleading UI quirk or a conflict in my environment...
I will try again tomorrow with the default installation. Failing that, I will try again after removing extraneous VS components.
About the registry hack, is it also not required with default installation (or will it be fixed in RTM)?
@jasonwilliams200OK it's not required with the default installation, and I don't fully understand what's up with the custom install yet. Once my hunch is verified by folks on this thread, we can start digging into that further...
@mousetraps
Here is my steps, hope those will help you address the problem:
Please offer a registry fix tool whether the problem was fixed before RTM or not. Thanks a lot.
@mousetraps,
You are right it works without registry hack.
npm config set msvs_version 2015 --global in cmd.=== Configuration Done ===
Then installing any native module package (such as npm install selenium-webdriver) worked fine.
Separate from this discussion
Note that at this point running %programfiles(x86)%\microsoft visual studio 14.0\vc\vcvarsall.bat without the registry hack throws: ERROR: Cannot determine the location of the VS Common Tools folder. So once i ran reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 /v 14.0 /t REG_EXPAND_SZ /d ^%programfiles(x86)^%"\Microsoft Visual Studio 14.0\\" in elevated command prompt, vcvarsall.bat command was successful afterwards.
I'm not sure if this belongs in this thread but its certainly Windows related.
This seems a huge problem - npm scripts everywhere set environment variables before running commands and this breaks on Windows of course because this command format is not valid.
Now that I understand the problem I am coming to realise that on Windows this breaks vast amounts of node and npm packages and in order to make just about anything work I will need to be constantly digging in to packaging source code to make things work. I wonder if anything can be done?
The problem is made even worse on Windows because Powershell and the Windows command prompt have a different syntax for setting environment variables. Ugh.
Here's an example of what I mean:
"scripts": {
"test": "NODE_ENV=test mocha --compilers js:babel/register --recursive --require ./test/setup.js $(find test -name '*.spec.js')",
"test-watch": "npm test -- --watch",
"test-e2e:crdv": "chromedriver",
"test-e2e": "NODE_ENV=test mocha --compilers js:babel/register --require ./test/setup.js --require co-mocha ./test/e2e.js",
"lint": "eslint .",
"hot-server": "node server.js",
"build": "NODE_ENV=production webpack --config webpack.config.production.js --progress --profile --colors",
"start": "electron .",
"start-hot": "HOT=1 NODE_ENV=development electron .",
"package": "NODE_ENV=production node package.js",
"package-all": "npm run package -- --all"
},
Perhaps a practical solution is for npm to detect commands that do platform-specific environment variable setting and rewrite those commands to work with Windows?
@dukedougal I know this is not a solution, but send them a PR and use https://www.npmjs.com/package/cross-env instead
@luisrudge millions of voices cry out in terror every time they get smashed with npm errors and this is a HUGE problem for Windows users. If npm / node.js are ever to coexist peacefully then this needs to be solved without users or packagers having to think about it - at least for the most common cases.
Microsoft, if it wants to reduce the massive pain of using node.js on Windows, should step up and modify npm to automatically handle transformation of unix style commands into Windows style commands.
Well.. while I like to dream of that, I doubt that this is even possible to do in in a reliable way..
@luisridge I thought this thread was meant to have the attention of some of MIcrosoft's finest minds? Surely some of them can turn their attention to fixing this issue. It doesn't seem like it should be that hard to modify a unix style command into a Windows style command and npm is the logical place to do that - in fact really the only place to do that.
I'm betting an analysis of all the package.json files in the npm repository would show vast numbers of them contain unix style environment variable setting prior to command execution. It's an import problem which MIcrosoft should fix.
@dukedougal
It's not as simple to fix once you start thinking about all the details.
On Thu, Nov 26, 2015, 16:58 dukedougal [email protected] wrote:
@luisridge I thought this thread was meant to have the attention of some
of MIcrosoft's finest minds? Surely some of them can turn their attention
to fixing this issue. It doesn't seem like it should be that hard to modify
a unix style command into a Windows style command and npm is the logical
place to do that - in fact really the only place to do that.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-159997986.
@impinball in most cases it's nothing more than setting an environment variable before executing a command - that's super simple - I think you're seeing a much bigger problem than I'm describing.
In my experience, the most obnoxious thing to do cross platform is
environment variables. Either use a build system which is already filled
with boilerplate, or use a complicated bunch of boilerplate around your
tools. It should be possible to make a wrapper script for executing
programs with specific variables, but I've had some trouble making this
seemingly trivial script.
And forget shell scripting. Bash and Coreutils have been ported to Windows,
but you can't assume that's on a Windows machine. Not very many Windows
users, even developers, have heard of Chocolatey.
The next most complicated part is dealing with native modules and supported
platforms/versions. Not "can this build that", but "does this support $OS"
(why I run into issues with Flow) and/or "does this support Node/iojs
$VERSION" (limiting my use of jsdom). A large SDK download is inconvenient,
but unless your development machine is that limited in space, it pales in
comparison to this.
But yes, I would appreciate not having to download the entirety of VS just
to compile some C++.
On Thu, Nov 26, 2015, 23:15 dukedougal [email protected] wrote:
@impinball https://github.com/impinball in most cases it's nothing more
than setting an environment variable before executing a command - that's
super simple - I think you're seeing a much bigger problem than I'm
describing.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-160038590.
@dukedougal,
Unix which comes default with bash (e.g.most Linux and OSX):
{
"task": "MY_TURNKEY=42 node pathto/myscript.js # does not work on FreeBSD.chs+Windows"
}
Unix which comes default with csh (e.g.FreeBSD):
{
"task": "setenv MY_TURNKEY 42; node pathto/myscript.js # does not work on Linux+OSX+Windows"
}
Windows cmd:
{
"task": "SET MY_TURNKEY=42 && node pathto/myscript.js :: does not work on Unix or Win.PowerShell"
}
Windows PowerShell:
{
"task": "$env:MY_TURNKEY=42; node pathto/myscript.js # does not work on Unix or Win.cmd"
}
As evident, I agree that there is a disharmony in that arena, but I don't think the solution is to write a 'cross-platform environment variable transformation layer' as it is more complicated that it appears.
The benefit of environment variable is to have set it once for all the scripts being imported during the process life-cycle. To achieve that you can probably make your script accept a parameter node myscript --turnkey=42 and then on top of myscript.js, fetch the value of turnkey and set it to process.env.MY_TURNKEY then rely on process.env.MY_TURNKEY everywhere. This will let you avoid parsing the command-line argument in every imported file by myscript.js.
@jasonwilliams200OK good analysis of the problem.
All I'm saying is that without a fix for this, large numbers of packages fail on Windows.
If a solution can be found _that automatically solves it for all packages_ then life will be much easier on Windows.
Sure, I could solve it myself but that means every single time into the future I need to install a package on Windows that uses environment variables in bash/Linux form (and most of them do) then I'll need to cast whatever spell is required. Many, many other users on Windows won't have the ability or the interest to fix it - I certainly don't have the interest to fix it, especially not over and over.
As I said earlier, if MIcrosoft want node.js and npm to work without deep pain for the user base, this needs to be addressed.
As an example, Babel has an env object for conditional plugin inclusion
that sucks if you're not using a complex build system and it has to build
on multiple platforms (e.g. you're using npm scripts). Otherwise, it's a
powerful tool.
On Fri, Nov 27, 2015, 02:50 dukedougal [email protected] wrote:
@jasonwilliams200OK https://github.com/jasonwilliams200OK good analysis
of the problem.All I'm saying is that without a fix for this, large numbers of packages
fail on Windows.If a solution can be found _that automatically solves it for all packages_
then life will be much easier on Windows.Sure, I could solve it myself but that means every single time into the
future I need to install a package on Windows that uses environment
variables in bash/Linux form (and most of them do) then I'll need to cast
whatever spell is required. Many, many other users on Windows won't have
the ability or the interest to fix it - I certainly don't have the interest
to fix it, especially not over and over.As I said earlier, if MIcrosoft want node.js and npm to work without deep
pain for the user base, this needs to be addressed.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-160061739.
As of this morning (2015-12-02), the download link for the Build Tools (https://www.microsoft.com/en-us/download/details.aspx?id=49512) appear to be broken. Found them at https://www.microsoft.com/en-us/download/details.aspx?id=49983
@jbblanchet et al - The "evergreen" link from now on for the latest Visual C++ Build Tools 2015 installer should be http://go.microsoft.com/fwlink/?LinkId=691132 . We're working on fixing any references to the download.microsoft.com website because those links are not available long-term. If you know of any other places that reference these old links, please let me know. Thanks!
@mluparu, as someone mentioned on VS blog in comments: http://blogs.msdn.com/b/visualstudio/archive/2015/11/30/visual-studio-update-1-rtm.aspx.
you guys announce a technical preview of Built Tools for C++ few weeks ago: www.microsoft.com/.../details.aspx. I can't find Update 1's counter part anywhere on www.visualstudio.com/downloads, not even under 'Tools for Visual Studio 2015'. The
Build Toolsunder that title is for C# not C++.. Please make it available. On this note, can you guys differentiate the names, so people don't confuse 'Build Tools 2015' and 'Build Tools 2015 for C++'..
Please rename the Build Tools 2015 for C++ to something like VC Runtime 2015 and make it available at http://www.visualstudio.com/downloads under Tools for Visual Studio 2015 section to make it easily discoverable.
Thanks for the suggestion. The official name is "Visual C++ Build Tools 2015" and while I understand the confusion it might create, there is little wiggle room here in branding.
This package will definitely show up on http://visualstudio.com/downloads when it RTMs, hopefully reducing that confusion even further, but for now, while it is still in technical preview, most of the announcements will be done through blogposts and forums.
@mluparu can this also be made available via powershell package management? It'd be pretty nice to be able to do install-package vcppbuildtools2015 (or whatever) and get it onto the system.
@factormystic I second that idea. Much easier to set up new Windows dev machines that way.
@mluparu can this also be made available via powershell package management? It'd be pretty nice to be able to do install-package vcppbuildtools2015 (or whatever) and get it onto the system.
This would be very useful for Windows Server Core (i.e. commandline only) as well as the new Nano server edition of Server 2016.
If there is also an option to extract the tools package as a standalone / self-contained folder, then this cli/text-based installer can also be made available via npm install vcppbuildtools2015 so people can conditionally take dependency on it (if(os.platform() === 'win32' && !HasAtleastVSVersionOrAbove(2015))).
+1
Anyway I did the clean install on Windows 10 on VM, I only installed:
MS Visual C ++ Build Tools Technical Preview
with both SDK 8.1 and 10, finally setup the global variable of NPM:
npm config set msvs_version 2015 --global

All perfect. :tada:
Is there any way to download MS Visual C ++ Build Tools Technical Installation Preview full offline?
I'll start by saying just thank you for all the suggestions. I hope we can further improve the acquisition of the VCBuild tools based on your ideas.
install-package work. My team has little experience with that yet, so if there is anyone here with experience that wants to take a stab at it and publish a package under their own name, I'd be interested in working with you to later adopt it and evolve it. npm install scenario. But presumably, if we achieve the above, maybe npm packages could take a dependency on it... /layout switch. In the output folder you provide, you will have a cached version of all the packages required for installation. Unfortunately, due to the way the WinSDK 10 acquisition works, this particular package cannot be cached so you would still need Internet connection for it. As is it today, the VCBuild tools require elevation so not sure how it would fit in an
npm installscenario.
- The PowerShell text-based installer should not launch any GUI.
- The PowerShell text-based installed should provide two modes
standaloneandsystem.
system: install the VC tools system-wide. This will be discoverable system-wide via registry. By default it will install at%ProgramFiles(x86)%\Microsoft Visual Studio 14.0, but user will be able to override it using--destinationargument, then it wil install atuser-defined-directory\Microsoft Visual Studio 14.0.
standalone: install the VC tools in thecurrent-directory\Microsoft Visual Studio 14.0. This will not alter the registry or anything outside the current directory. It will not be discoverable system-wide, but only act like a standalone build kit which can be used to compile C/C++ code without further dependency. This will also accept the--destinationargument. If we domy-custom-dir\Microsoft Visual Studio 14.0\vc\bin\cl test.c /TP, it should resolve all the dependencies local to the installed package, to make the code compile.
- The npm text-based installed should provide three modes
global,standaloneandsystem.
system: same as above. The post install JS code will simply bail out after spawning the PowerShell install script withsystemargument.
standalone: same as above, except it will be hardcoded with--destination=.\node_modules\.
global: this is npm globalnpm install -g <package-name>, so it is a predefined location by npm and only "globally discoverable" by npm. Again npm will just spawn PowerShell install script as:
".\install-vc-tools.ps1 --standalone --destination=" + npmGlobalInstallLocation
Wondering if C++17 modules will provide us exemption to recompile the v8 binding: http://blogs.msdn.com/b/vcblog/archive/2015/12/03/c-modules-in-vs-2015-update-1.aspx? Its a new stuff, could be with that feature, we may not even need FFI in future..
@jasonwilliams200OK
No, because:
@impinball, you made good points. What I understood by the Native Modules blog post is that they will be compiled once for the given architecture and then consumers will be able to interact with them without recompiling. (same concept as shared libraries but with bit more 'flexibility' such as needing to have header files to program against the API):
Modules allow you to express the symbolic dependency your component is taking on providers of functionalities it needs, and the boundary of that dependency, directly in code. Modules eliminate the need for convoluted preprocessor voodoo to specify interfaces through header files. The preprocessor is there for you and works together with the modules system if you have no other choice but to work with macro-based interfaces, conditional compilation and code-generation. The preprocessor is a powerful beast with no structure and C++ Modules aren’t designed to do everything that it does. The preprocessor’s job is to generate pre-tokens for the lexer to consume. It has been put to creative usages, for more than 40 years, to generate various sorts of text, including HTML source documents.
I might be interpreting it incorrectly, need to play with this stuff more to find out 'what Native modules mean to FFI / JNI / P-Invoke'. :)
HELP!
A Pain in the right backside! I thought had all this going but now i've got issues with the node modules that use v8, anyone know how to fix this ? i have many c++ compile errors like:
c:usersnick.gray.node-gyp4.1.2includenodev8.h(3181): error C2504: 'v8::O
bject' : base class undefined [C:Usersnick.grayDesktopxxxkerberosbuildke
rberos.vcxproj]
c:usersnick.gray.node-gyp4.1.2includenodev8.h(3188): error C2061: syntax
error : identifier 'FunctionCallback' [C:Usersnick.grayDesktopxxxkerberos
buildkerberos.vcxproj]
c:usersnick.gray.node-gyp4.1.2includenodev8.h(3190): error C2059: syntax
error : ')' [C:Usersnick.grayDesktopxxxkerberosbuildkerberos.vcxproj]
c:usersnick.gray.node-gyp4.1.2includenodev8.h(3190): error C2143: syntax
error : missing ')' before ';' [C:Usersnick.grayDesktopxxxkerberosbuild
kerberos.vcxproj]
c:usersnick.gray.node-gyp4.1.2includenodev8.h(3194): error C2061: syntax
error : identifier 'FunctionCallback' [C:Usersnick.grayDesktopxxxkerberos
buildkerberos.vcxproj]
Thanks Nick
I got this error when i try install protractor-perf bufferutil dependency.
I'm on windows8.1 installed python 2.7 and visual studio 2015 community, nodejs 5.0 npm 3.3.6
> [email protected] install E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil
> node-gyp rebuild
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil>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.
bufferutil.cc
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(263): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)': function template has already been defined [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(256): note: see declaration of '_NanEnsureLocal'
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(661): error C2039: 'FreeCallback': is not a member of 'node' [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\�d�m\.node-gyp\5.0.0\include\node\node_object_wrap.h(8): note: see declaration of 'node'
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(661): error C2061: syntax error: identifier 'FreeCallback' [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(665): error C2065: 'callback': undeclared identifier [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(665): error C2065: 'hint': undeclared identifier [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(672): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\�d�m\.node-gyp\5.0.0\include\node\node_buffer.h(43): note: could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,char *,size_t)'
C:\Users\�d�m\.node-gyp\5.0.0\include\node\node_buffer.h(31): note: or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,v8::Local<v8::String>,node::encoding)'
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(672): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(676): error C2440: 'return': cannot convert from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>' [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(676): note: No constructor could take the source type, or constructor overload resolution was ambiguous
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(683): error C2039: 'Use': is not a member of 'node::Buffer' [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
C:\Users\�d�m\.node-gyp\5.0.0\include\node\node_buffer.h(8): note: see declaration of 'node::Buffer'
E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\nan\nan.h(683): error C3861: 'Use': identifier not found [E:\Programing\Attrecto\aig-pdh-qascripts\node_modules\protractor-perf\node_modules\bufferutil\build\bufferutil.vcxproj]
@devmetal Install a newer version of bufferutil, latest is 1.2.1.
@bnoordhuis Okay, i installed and its fine, but the protractor-perf package depend on bufferutil, what can i do?
Edited:
Interesting, if i install protractor-perf -g its working fine, but locally its fail
@devmetal File an issue with them asking them to upgrade their dependencies.
Sorry, my problem solved by god i think because i tried again and again and it works...
My steps:
Delete node_modules folder
Delete protractor-perf from package.json
Install again with --save switch
After npm install for others.
After this steps, i deleted my node_modules again and install again and it works.
(deleted)
I got kerberos working. I had to use node v. 0.10.0 , use nvm. To change versions of node. And also follow these steps exactly . In order. Make a restore poont after each step. As it may fail. And fix the link error that must be done! https://github.com/nodejs/node-gyp/wiki/Visual-Studio-2010-Setup
I'm on Windows Server 2012 R2
with Visual Studio Enterprise 2015 (with Visual C++ compiler)
and this node-gyp crap still doesn't work...
Look at that:
$ npm install [email protected] --save
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
|
> [email protected] install {my-project-path}\node_modules\angular\node_modules\jsdom\node_modules\contextify
> node-gyp rebuild
/
{my-project-path}\node_modules\angular\node_modules\jsdom\node_modules\contextify>if not defined npm_config_node_gyp (node "c:\bin\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.
{my-project-path}\node_modules\angular\node_modules\jsdom\node_modules\contextify\build\contextify.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp .Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\bin\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:\\bin\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd {my-project-path}\node_modules\angular\node_modules\jsdom\node_modules\contextify
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:\\bin\\nodejs\\node.exe" "c:\\bin\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "[email protected]" "--save"
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 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! {my-project-path}\npm-debug.log
I started reading contextify guidelines for Windows Installation, but I had enough.
This is a joke...
Fortunately I somehow managed to fix problem with karma installation on my personal Win10 desktop: https://github.com/karma-runner/karma/issues/1691
Unfortunately this is a lottery. My friend, with a similar setup, wasn't able to fix it...
Sorry for all the frustration...
I'm going for a holiday...
NOW!
I am with you. I am having similar issues trying to get fibers going on a
2012 x64 server..... Now have to try and work with various teams to get
patches for their packages.... this is not a stable approach to deploying
solutions.... I know that several folks on this thread have been attentive
to the issue and appreciate that and dont mean any disrespect.
On Thu, Dec 10, 2015 at 7:54 AM, Lukasz Piatkowski <[email protected]
wrote:
I'm on Windows Server 2012 R2
with Visual Studio Enterprise 2015 (with Visual C++ compiler)
and this node-gyp crap still doesn't work...Look at that:
$ npm install [email protected] --save
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
|[email protected] install {my-project-path}node_modulesangularnode_modulesjsdomnode_modulescontextify
node-gyp rebuild/
{my-project-path}node_modulesangularnode_modulesjsdomnode_modulescontextify>if not defined npm_config_node_gyp (node "c:binnodejsnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
{my-project-path}node_modulesangularnode_modulesjsdomnode_modulescontextifybuildcontextify.vcxproj(20,3): error MSB4019: The imported project "C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.Cpp .Default.props" was not found. Confirm that the path in thedeclaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error:msbuildfailed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:binnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.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:binnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd {my-project-path}node_modulesangularnode_modulesjsdomnode_modulescontextify
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:binnodejsnode.exe" "c:binnodejsnode_modulesnpmbinnpm-cli.js" "install" "[email protected]" "--save"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLEnpm 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 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! {my-project-path}npm-debug.logI started reading contextify guidelines for Windows Installation, but I
had enough.
This is a joke...Fortunately I somehow managed to fix problem with karma installation on
my personal Win10 desktop: karma-runner/karma#1691
https://github.com/karma-runner/karma/issues/1691Unfortunately this is a lottery. My friend, with a similar setup, wasn't
able to fix it...Sorry for all the frustration...
I'm going for a holiday...
NOW!—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-163624812.
@donaldhook Sure! No disrespect whatsoever, just needed to vent a bit :)
We use jspm for installing our packages.
jspm install npm:[email protected] seems to be working fine + we keep dependencies under version control so it should be easy/easier to pick it up.
thanks @mousetraps solved my life problems. can actually do work now.
@op1ekun, going by this line in the error log you reported:
{my-project-path}\node_modules\angular\node_modules\jsdom\node_modules\contextify\build\contextify.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp .Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
(catch is: v4.0)
perhaps this will fix your issue:
Sometimes on Windows 8/10, either msbuild in PATH or which node-gyp infers is not the latest one (note that you may have multiple versions of msbuild installed, one with VS and one with some version of .NET Framework and so on). To fix this problem, prepend the value of
Environment Variables > Pathwith latest msbuild.
After that open a new cmd instance and run npm install [email protected] --save.
@am11 This is exactly the problem I am having! I spent a many hours banging my head against the wall because I could use npm and node-gyp without issue from CMD (I did a complete Visual Studio 2015 pro installation) but in PowerShell I get MSBuild errors unless I have
$env:Path = ${env:ProgramFiles(x86)} + "\MSBuild\14.0\bin;" + $env:Path
in my PowerShell profile. And it must be _prepended_, not _appended_. I spent the better part of an afternoon isolating the environment variables that were different between CMD and PS and one by one testing to see which made the difference (I wish I would have found this thread sooner!!). The thing I'm not really clear is that the PATH variable is the same in both environments (before I modify it as I mentioned above. It bugs me to no end that I can't isolate the breaking difference between the two even after examining VsDevCmd.bat' andVsMSBuildCmd` in detail. To make it even more frustrating, npm succeeds at a regular Command Prompt - it doesn't even have to be a Developer Command Prompt.
In the figure shown previously, I prepended the system environment path.
The precedence order of environment variable is process, system and then user. In your case, it seems like cmd is inheriting the msbuild from some startup/autoexec script (for the current process) which is why it is not visible in user/system PATH and the fact that in PS it was unavailable. You can always check the msbuild version with msbuild /version.
it doesn't even have to be a Developer Command Prompt
To be fairly honest, Developer Command Prompt is not the requirement when your project relies on MSBuild and it is discoverable via PATH.
Some additional CLI gotchas:
:: in cmd / bat
:: To change the current process PATH:
SET PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin\;%PATH%
:: To change the `user` PATH:
SETX PATH %ProgramFiles(x86)%\MSBuild\14.0\Bin\;%PATH%
# in PowerShell
# To change the current process PATH:
$env:PATH="${env:ProgramFiles(x86)}\MSBuild\14.0\Bin\;$env:PATH"
# To change the `user` PATH:
SETX PATH "${env:ProgramFiles(x86)}\MSBuild\14.0\Bin\;$env:PATH"
To change the system environment variable, the shell needs to be running as administrator, then: use the /m switch as in: SETX /m ....
@am11
Interesting! I will have to investigate further. It's not enough that it works, I really like to understand _why_ it does.
I have no idea how to diagnose what is wrong.
this is what PowerShell reads after I type npm install msvs_version=2015
I've installed the build tools, then tried visual studio 2015 community edition, both at least twice. reinstalled node and python several times. I don't know anything about this stuff or how to make it work, trying to match the error codes with other errors in this thread hasn't gotten me very far.
Could someone please skim through that log and point me in the right direction? Thanks!
@benflinn, since stocks4you is not available on http://npmjs.org, so I tried to install node-inspector package instead which is the failing dependency going by your error log. It successfully installed here. My environment is:
npm config set msvs_version 2015 --global (ran once)I think you just need to reference some higher version of node-inspector (current version is v0.12.5) in your package.json file.
@am11 thanks for pointing that out, installed node-inspector v0.12.5 globally and it seems to be working now! :)
@mousetraps Please add to your guide that it is important to install BOTH Windows 8 SDK AND Windows 10 SDK during the Build Tools install. Or that if node-gyp prints errors that it cannot open include file [some Windows SDK header-file] that this can be fixed if you customize your Build Tools and install BOTH SDKs.
I had previously thought that the default install option with only Windows 8 SDK is sufficient, but it wasn't.
This was the case for @mtpultz and @ricmed205 under Windows 10 and for me under Windows 7.
Maybe the error is that the installer is putting the required header files only in "C:Program Files (x86)Windows Kits10Include" and not in "C:Program Files (x86)Windows Kits8.1Include" even if I select only Windows 8 SDK during install which seems strange.
@hfinger, that is not the built tools error. It is gyp error that it does not locate Windows 10 SDK (which for the first time in a very long time is at a different location than its predecessors).
@jasonwilliams200OK, I disagree there, but I am no expert. Other people who are installing on a fresh VM are not having this issue. Just to repeat my steps, I first uninstalled everything associated with Visual Studio / .net Framework / Windows SDKs. Then I started fresh with the guide of @mousetraps to install Build Tools. The default install option (at least on Windows 7) is that it installs only the Windows 8.1 SDK and NOT the Windows 10 SDK. During install it puts stddef.h and winsock2.h etc in "Windows Kits10Include" although I only installed SDK 8.1. These files are missing in "Windows Kits8.1Include".
Only if I then also install Windows 10 SDK, node-gyp works. So gyp is definitely locating the Windows 10 SDK. It seems it was not locating the Windows 8.1 SDK header files, because Build Tools installed headers only in the Windows 10 SDK folder, although I only installed Windows 8.1 SDK.
@hfinger, gyp is NOT locating Windows 10 SDK. See https://github.com/nodejs/node-gyp/issues/679#issuecomment-137970103.
@jasonwilliams200OK I know that this fixes it, because I used that workaround before installing Windows 10 headers. But, it is strage that I would hard code the location of the Windows 10 SDK header files in gyp, although I DID NOT install Windows 10 SDK. I installed only WIndows 8.1 SDK.
So if you are using that workaround by modyfing common.gypi, you might instead just install the Windows 10 SDK correctly in addition to the Windows 8.1 SDK. At least for me that solved it without the need to hard code the location of the header files in gyp. So, I am quite sure that Build-Tools installer produced a weird setup on my disk, because it installs Windows 8.1 headers in the wrong folder.
@hfinger, in this case, you are the first one running into it after: https://github.com/nodejs/node-gyp/issues/629#issuecomment-159808154 (also see comments above and below that one). I have tested it thoroughly and custom install was not required on at least Windows 7 fresh installation. Maybe the package i was testing (selenuim-webdriver) wasn't using those misplaced headers.
The link was updated https://www.microsoft.com/en-us/download/details.aspx?id=49983 (now uses the updated version of compiler which comes with VS2015 Update 1). I used default install on Windows 7 without any hack and it worked.
@mousetraps I am on a fresh copy of Windows 8 and the Microsoft Build Preview tool fails to install.
EDIT: I was to install the Microsoft tool. Make sure you do a Windows update. Now I tried to do a npm install and I kept getting this.
C:\ProgramData\chocolatey\lib\Cygwin\tools\cygwin\home\William\projects\lootz\no
de_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program F
iles\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n
ode-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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ
ets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [C:\ProgramDa
ta\chocolatey\lib\Cygwin\tools\cygwin\home\William\projects\lootz\node_modules\
utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:88:13)
gyp ERR! stack at ChildProcess.emit (events.js:173:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:201:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\ProgramData\chocolatey\lib\Cygwin\tools\cygwin\home\William\proj
ects\lootz\node_modules\utf-8-validate
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp re
build`
npm WARN install:[email protected] Exit status 1
npm WARN EPEERINVALID [email protected] requires a peer of kerberos@~0.0 but n
one was installed.
Still having errors after installing python 2.7, VC++ Build Tools Technical Preview and setting npm config set msvs_version 2015 --global as @mousetraps suggested
Here's what I see in console:
bufferutil.cc
C:\Users\Dmitry_Kabardinov\.node-gyp\4.0.0\include\node\v8.h(18): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory [C:\Users\Dmitry_Kabardinov\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_module
s\ws\node_modules\bufferutil\build\bufferutil.vcxproj]
@dKab I had the same error message. I solved it by again starting the Build Tools installer and clicking customize and then installing BOTH SDKs.
Or alternatively, by manually modyfing the include paths as suggested here: https://github.com/nodejs/node-gyp/issues/679#issuecomment-137970103
@hfinger
I solved it by again starting the Build Tools installer and clicking customize and then installing BOTH SDKs.
It worked! Thanks, man! You are the best.
I also found it was necessary to manually select the Windows 10 SDK when installing Visual C++ Build Tools 2015 as described by https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245.
Typical install, you don't have to choose both SDKs, the installer will do the right thing.Custom install then you have to chose BOTH SDKs.So the better workaround at the moment is to chose Typical install.
Meanwhile, Microsoft should fix the installer to work with default SDK when user selects custom install.
If you select Typical install, you don't have to choose both SDKs, the installer will do the right thing.
@jasonwilliams200OK No, that is definitely not correct!! It might be working for you if you are installing on a fresh Windows machine, but not if you had previously old Versions of Visual Studio or some other stuff installed! I made sure to first uninstall all old Visual Studios and SDKs and then did a "Typical" install and it did not work!
@hfinger, you are mistaken dude. try again.
@jasonwilliams200OK No I am not. If the "Typical" install works on your system but not on mine (and many others), then I am correct, that the "Typical" install might be working on some systems but is not working on 100% of all systems. There is no reason to try again, because with the custom install, I was able to fix it.
@hfinger, you didn't mentioned which package failed to install on your system and which Windows version you were trying on? @mousetraps, specifically discussed this issue above and unable to reproduce herself. If you don't care to read what she is asking and what has been already discussed, then this whole conversation is pointless and redundant. Nobody has provided steps to reproduce that scenario. I tried several times in different Windows 7 x86-32 VMs lately (full steps to repro were made available above), but didn't hit this issue which is why I asked you to try again. Although I know exactly how painful it is to figure out minimum steps to repro in this kind of situation, but like every other software development bug situation: if you don't care to try again or provide real reproducible steps, then NOTHING is definite and speculations will complicate the process. Though I would love to test if you or anyone else can provide reproducible steps. And if proven wrong, I will vote for docs update and even send a PR. Until that time, it is a "maybe required/extra step".
@jasonwilliams200OK I tried several packages, but during the several reinstalls of Build Tools I mostly just tried bufferutil.
I specifically answered that question by @mousetraps and said that I had first choosen Default install, which was not working. Then selecting custom install with both SDKs made it working. I am just trying to help here, by saying how I was able to fix that problem. And it seems there are many other people (@dKab @ariofrio), who also needed the custom install for it to work.
I don't see how you are helping the discussion by saying that the bug does not exist, because in your VM with a clean Windows you cannot reproduce the bug. Just guess how many people are not on a clean windows. Anyway, I will not further reply, because I already said where the bug is and how to fix it. It would just be easier if it is included in the guide, because I myself spend several hours reinstalling several times and reading this thread. Or do you want to include in the guide as a first step that you have to reinstall Windows?
It made it much more hard to solve, because people like you are saying the Default install has no bug. I am reporting that it has a bug and I am not hallucinating that. And I even said, how I was able to solve that bug. I don't mind your VM setup. Why should I "try again"? I already solved it by doing the custom install.
Why should I "try again"?
If you don't want to try again, then stop misguiding others.
I tried to install Yandex Gemini on Windows 10 and getted error
\appdata\roaming\npm\node_modules\gemini\node_modules\png-img\third_party\libpng\pngpriv.h(44): fatal error C1083: Cannot open include file: 'stdlib.h'
So this helped me:
npm config set msvs_version 2015 --global
npm install -g --msvs_version=2015 node-gyp rebuild
npm install -g gemini
PS. Commands like "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\SetEnv.CMD" /Release /x64
NOT NEEDED.
Can all Windows tests please use Node v4.3.2 as a minimum as it has LTS.
1) Installed nodejs LTS 4.2.3
2) Python 2.7
3) Microsoft Visual C++ Build Tools 2015 Technical Preview
4) Install Visual Studio 2015 Community https://www.visualstudio.com/en-us/downloads/dn469506 in Custom install: with Visual C++
5) Add system envirompment var: GYP_MSVS_VERSION=2015
Getting the following error (fatal error C1189) if I want to run npm install canvas
C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm”glichen, mssen Sie den Schalter "/m" hinzufgen.
Canvas.cc
CanvasGradient.cc
CanvasPattern.cc
CanvasRenderingContext2d.cc
color.cc
Image.cc
ImageData.cc
init.cc
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\Canvas.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\Canvas.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\Canvas.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\CanvasPattern.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\CanvasPattern.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\CanvasPattern.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
PixelArray.cc
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\CanvasGradient.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\CanvasGradient.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\CanvasGradient.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\color.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\color.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\color.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\init.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\init.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\init.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\Image.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\Image.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\Image.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\ImageData.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\ImageData.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\ImageData.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\PixelArray.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\PixelArray.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\PixelArray.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: "snprintf": Makro-Neudefinition (Quelldatei wird kompiliert ..\src\CanvasRenderingContext2d.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): note: Befehlszeilenargumente: siehe vorherige Definition von "snprintf" (Quelldatei wird kompiliert ..\src\CanvasRenderingContext2d.cc)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (Quelldatei wird kompiliert ..\src\CanvasRenderingContext2d.cc) [C:\workspace-js\cme-content-crawler-suppilo\node_modules\canvas\build\canvas.vcxproj]
@frankred, this issue (that C99 snprintf shouldn't be redefined for VS2015) was fixed in canvas v1.3.5 (Automattic/node-canvas#670).
# powershell
#
# Download GTK v2 from:
# http://ftp.gnome.org/pub/GNOME/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
# and extract it to C:\GTK
# for more details, see:
# https://github.com/Automattic/node-canvas/wiki/Installation---Windows#2-installing-gtk-2
#
npm install canvas
# or specify 'dist label' => npm install canvas@latest
# or from GitHub (if you have `git` in PATH) => npm install Automattic/node-canvas
# success!
@am11 thanks a lot, just made a version update and now everything works!
Hi everyone,
I solved this problema on windows 8 and windows 10 pro with this tutorial.
I try a lot of times to solve this problema with many different solutions, but only worked for me with this:
http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64
I notice that i didn't use nodist to control the node version like this tutorial, I use NVM and worked fine, i don't test this tutorial with nodist. I used node 5.2.0.
This may be (partially) fixed, but you've got a way to go. I am having major problems with node-gyp on Windows 7 behind a corporate proxy:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp http GET https://atom.io/download/atom-shell/v0.34.5/node-v0.34.5.tar.gz
gyp WARN install got an error, rolling back install
gyp
Note the complete lack of information about what the error was, or a clue how to resolve it.
I (finally) got npm to work happily with this environment. node-gyp still doesn't, which means Atom doesn't, which means I can't install Atom packages.
Which means I may have to switch from Atom. For want of a nail...
@alflanagan Can you confirm this version of Node you're using? It look like you're using v0.10.40 which isn't supported by the fix stated above.
Happy to be proven wrong, but I believe it only supports v4+
@justrhysism, as far as node-sass is concerned, I have successfully tested this setup (via nvmw) to work with: v0.10, v0.12, v1.0.x, v1.1+.x, v2, v3, v4 and v5. Note in v1, NODE_MODULE_VERSION changed twice (in io.js days), which is why we have two separate binaries for each platform combination for v1 line.
@am11 node-sass? This thread is discussing node-gyp.
I also would be reluctant to rely on nvmw, because as good as it the tool itself is trying to be, it is very much hamstrung by the Windows environment. Manipulating the PATH doesn't pass onto child processes correctly, and can cause issues (even with node-sass) if builds are conducted in a child process which is running a different version of node (the global version).
@justrhysism, yes node-sass is using node-gyp. Sorry I thought this bit was obvious.
When I tried to mongodb for node.js, I used npm install mongodb directly and get the following info:
npm WARN peerDependencies The peer dependency kerberos@~0.0 included from mongod
b-core will no longer be automatically installed to fulfill the peerDependency
in npm 3+. Your application will need to depend on it explicitly.
/
[email protected] install C:nodejsnode_modulesmongodbnode_moduleskerberos
(node-gyp rebuild) || (exit 0)C:nodejsnode_modulesmongodbnode_moduleskerberos>if not defined npm_config_n
ode_gyp (node "C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin....
node_modulesnode-gypbinnode-gyp.js" rebuild ) else (node rebuild )
then cmd just stuck there without forwarding.
So I terminated the batch job by <ctrl-c>
I made some search and found some instructions here
I didn't follow the tool chain in the page instead I tried @mousetraps thread here on a fresh win 7 x64 because I had followed that and get a failure in the end. That's why I am here now.
Other things not changed in the mongodb instructions page.
My working directory is C:\nodejs so I copy node.exe file from C:\Program Files\nodejs to here.
After I followed the instruction to run command line: npm install -g node-gyp
Things going well but the next one: npm install Errors fly.
npm WARN package.json [email protected] license should be a valid SPDX license exp
ression[email protected] install C:nodejskerberos
(node-gyp rebuild) || (exit 0)C:nodejskerberos>if not defined npm_config_node_gyp (node "C:Program Filesno
dejsnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
kerberos.cc
worker.cc
security_buffer.cc
security_buffer_descriptor.cc
c:userskk210.node-gyp4.2.4includenodev8.h(18): fatal error C1083: Cannot
open include file: 'stddef.h': No such file or directory (compiling source fil
e ..libwin32kerberos.cc) [C:nodejskerberosbuildkerberos.vcxproj]
c:userskk210.node-gyp4.2.4includenodev8.h(18): fatal error C1083: Cannot
open include file: 'stddef.h': No such file or directory (compiling source fil
e ..libwin32wrapperssecurity_buffer_descriptor.cc) [C:nodejskerberosbuil
dkerberos.vcxproj]
c:userskk210.node-gyp4.2.4includenodev8.h(18): fatal error C1083: Cannot
open include file: 'stddef.h': No such file or directory (compiling source fil
e ..libwin32wrapperssecurity_buffer.cc) [C:nodejskerberosbuildkerberos.
vcxproj]
c:userskk210.node-gyp4.2.4includenodev8.h(18): fatal error C1083: Cannot
open include file: 'stddef.h': No such file or directory (compiling source fil
e ..libwin32worker.cc) [C:nodejskerberosbuildkerberos.vcxproj]
security_context.cc
security_credentials.cc
..libwin32wrapperssecurity_context.cc(1): fatal error C1083: Cannot open in
clude file: 'assert.h': No such file or directory [C:nodejskerberosbuildker
beros.vcxproj]
c:userskk210.node-gyp4.2.4includenodev8.h(18): fatal error C1083: Cannot
open include file: 'stddef.h': No such file or directory (compiling source fil
e ..libwin32wrapperssecurity_credentials.cc) [C:nodejskerberosbuildkerb
eros.vcxproj]
gyp ERR! build error
gyp ERR! stack Error:C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exefail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:Program Filesnodejsnode_modules
npmnode_modulesnode-gyplibbuild.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:Program Filesnodejsnode.exe" "C:Program Filesnodej
snode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd C:nodejskerberos
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
[email protected] node_modulesnan[email protected] node_modulesnodeunit
└── [email protected] ([email protected], [email protected], [email protected], [email protected]
, [email protected], [email protected], [email protected], [email protected], [email protected], runforcove
[email protected])
And these follow the command: 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 C:Python27python.EXE
gyp info spawn args [ 'C:Userskk210AppDataRoamingnpmnode_modulesno
de-gypgypgyp_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:nodejskerberosbuildconfig.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:Userskk210AppDataRoamingnpmnode_modulesno
de-gypaddon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:Userskk210.node-gyp4.2.4includenodecommon
.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:Userskk210.node-gyp4.2.4',
gyp info spawn args '-Dnode_gyp_dir=C:Userskk210AppDataRoamingnpmn
ode_modulesnode-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=C:nodejskerberos',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:nodejskerberosbuild',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:Program Files (x86)MSBuild14.0binmsbuild.exe
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.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:nodejskerberosbuildbinding.sln]
gyp ERR! build error
gyp ERR! stack Error:C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exefail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:Userskk210AppDataRoamingnpmno
de_modulesnode-gyplibbuild.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:Program Filesnodejsnode.exe" "C:Userskk210AppDat
aRoamingnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd C:nodejskerberos
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
My configuration is:
npm 2.14.12
node.js 4.2.4LTS
Python 2.7.11 Install for all users with check of Add python.exe to Path
Visual C++ Build Tools with default installation
All my command is in cmd.exe and I am afraid many of my steps are wrong because I am really a fresh starter. What is exactly the routine to build c++ extention for Node.js on Windows? Don't hesitate to hit me clearly because I'm already painful enough here.
@am11 oh you're _building_ node-sass. No, that wasn't obvious.
Did you have a global version of Node installed when using nvmw? I've had issues in the past when a global Node _has_ been installed, and the build used the global version instead of the version on the PATH, causing mismatches with the binaries.
I know you got it working, but I have dealt with much pain attempting to reliably use nvmw recently and have decided to ultimately drop it's use for my team.
@am11 It was said that you have been successfully tested on kerberos with the solution provided by @mousetraps from here,right? Could you please kindly give some detailed instructions for such a newbie like me? Hopefully I could have some hints about the problem.
@krave1986,
Visual C++ Build Tools with default installation
Although some people are suggesting Default installation should work; you may want to try reinstalling Visual C++ Build Tools, select Custom install option and check both SDKs. The rest of your configuration seems correct.
@am11
I have solved the problem about missing stddef.h and another MSB4025 issue as the hint from here
I have not try the Custom install option for now because I thought the LNK error below could be solved. Just take Custom install option as my next movement.
Having tried many ways to reduce errors. This is as far as I can go, the error goes like:
LINK : fatal error LNK1104: cannot open file 'libucrt.lib' [C:ttstnode_module skerberosbuildkerberos.vcxproj]
While the libucrt.lib is just in: C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx64 C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86
I have Visual C++ Build Tools installed which I found in this issue
My command is just: npm install kerberos.
Many said that LIB and INCLUDES should be modified, but how should I modify them?
@fresc81 @jasonwilliams200OK
Could you please also help to check the problem?
Many thanks!
Could https://github.com/PythonJS/PythonJS be used to remove the dependency on Python 2.7?
@m1sta, packages can use cmake-js today and get independent of Python once and forever. cmake has zero external dependncies and a pure C/C++ solution to build C/C++ projects, for which you surely already have compiler installed. So, if you remove try-compile, and all system introspection, find_program, find_library, etc. Also remove the ability to compute depends in makefiles. If you took all those features away from cmake, you would be left with this cool thing called Gyp.
@am11 Finally solve the problem by custom installation of Visual C++ Build Tool with both SDKs selected. Although with some yellow warnings during the npm install stage, it is so happy to see mongodb modules. :+1:
@mousetraps Just to remind that the VC++ Build Tools Technical Preview link here is already invalid.
There should be another version after preview, right? I uploaded the preview file here in case somebody else would need the package before a new one established.
@jasonwilliams200OK Very helpful and impressive writing about all of this. Thank you very much.
Thank you all.
@jasonwilliams200OK I clearly have been living under a rock to have not ever heard of cmake.js. Why is this not more popular?
Are you aware of any tools or tutorials to transition a node-gyp based projects to cmake.js projects?
@m1sta, I think the readme of that project repo has pointers on how to configure your package. After that Google is your friend to figure out "how to do X with cmake". The general idea is, whatever makes you productive with less hassle, with less dependencies and makes your users happy, just use it.
Why is this not more popular?
node-gyp first commit: Feb 3, 2012
cmake-js first commit: Mar 24, 2015
gyp was created by Google guys (Chrome team mainly), who are switching to a new replacement called gn. So gyp is kind of getting tanked. Cmake (https://github.com/kitware/cmake) is an alternative solution, used by many industry grade products too, and (IMO) much more mature and popular in the world than gyp.
v8 and libuv are the common denominators in Chrome and node.js, probably the reason why node.js guys preferred gyp as a weapon of choice in first place.
In this long thread alone, there are at least two issues which can be squashed if cmake is used: locating correct SDK on Windows 10 and using correct msbuild version given multiple installed VS/msbuild versions on target. Plus no dependency on Python (or worse, a specific version of Python on every install target, this in addition to the actual C/C++ compiler requirement).
An example: libgd is using cmake, node-gd (wrapper) is using node-gyp. libgd is supported on Windows, while node-gd is yet to introduce Windows support. If node-gd is configured with cmake-js today, it will take close to none effort to introduce Windows support with VS and Build Tools 2015 (hint: cmake's built-in system introspection as opposed to manually written Python, SH, Powershell or CMD scripts to find dependent libraries etc.); https://github.com/libgd/libgd/pull/192 has been merged.
Hello everyone,
I got a bunch of errors on the line of this issue, tried much of the workarounds/solutions/fixes indicated here, but still getting an error: No such file or directory.
I wrote a detailed gist to illustrate: https://gist.github.com/javlc/67220256c6e51573dc07
For anyone still got node-gyp build issues such as corrupted library (node.lib). May be upgrade to node 5.4 stable does help. I tried to re-installed everything but things didn't work out until I upgraded my node installation. And for the sake of Windows installing instruction, the Windows 7 SDK in the README is not really necessary if you're on Windows 10.
We're having success using the the c++ compiler that comes with the strawberry perl package: http://strawberryperl.com. This lets us build on a windows 7 machine without VS installed & is faster than vsbuild.exe.
Unfortunately on a machine that has both the strawberry perl provided compiler and the VS c++ compiler we still can't build as node-gyp defaults to choosing vsbuild.exe. Any advice on how to beat that would be welcome ;)
My config:
I get an error installing buffertools:
npm install buffertools
npm config set msvs_version 2015 --globalLog extract:
C:\GBV\GBV_APILocal>npm install buffertools
> [email protected] install C:\GBV\GBV_APILocal\node_modules\bufferutil
> node-gyp rebuild
C:\GBV\GBV_APILocal\node_modules\bufferutil>if not defined npm_config_node_gyp (
node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modu
les\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar l
a compilación en paralelo, agregue el modificador "/m".
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(35
6,5): error MSB6006: "CL.exe" salió con el código -1073741515. [C:\GBV\GBV_APIL
ocal\node_modules\bufferutil\build\bufferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\MSBuild\14.0\bin\msbuild.exe` failed wit
h exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\GBV\GBV_APILocal\node_modules\bufferutil
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1
> [email protected] install C:\GBV\GBV_APILocal\node_modules\utf-8-validate
> node-gyp rebuild
It seems _-1073741515_ error code is about a missing DLL, I found that error code in @thevinci comment: https://github.com/nodejs/node-gyp/issues/629#issuecomment-165334528 but no solution was proposed.
I can't imagine whats going wrong...
I'm totally stuck at the moment.
@Thelmos Just a reminder from a non-English speaker to check the paths of related resources if there is any non-English letter or symbol in the paths. I have not seen the exactly same error of MSB6006. But you can try your luck. :)
@Thelmos, in addition to @krave1986's suggestion, take a look at https://github.com/bnoordhuis/node-buffertools/issues/44 where the owner pointed to solution at https://gist.github.com/kosmobot/6020327. In my case, I couldn't locate setenv.cmd on a system running Windows 10 with these SDKs installed: v7.0, v7.0A, v7.1A, v8.0A, v8.1A and v10.0A; but buffertools does get installed without any compilation error. Some more information is available in gyp issue tracker: https://code.google.com/p/gyp/issues/detail?id=457 (note that the status of that ticket is still new, so we may expect a permanent fix from upstream at some point).
If none of the prescribed solutions work, you may want to try changing the PATH environment variable, so gyp picks up the correct msbuild version 14.0: https://github.com/nodejs/node-gyp/issues/629#issuecomment-163686121.
PS: note that -1073741819 is a very low-level nt.dll exception, which translates to STATUS_ACCESS_VIOLATION (0xC0000005) which could mean anything in this higher context. However, MSB6006 is the key here.
@krave1986 I can't find any path with special chars, log messages are very poor in this aspect, I would like some information about what file is missing.
@am11:
I can't locate setenv.cmd but at least in https://github.com/bnoordhuis/node-buffertools/issues/44 log dump there is a clear message: The reference assemblies for framework ".NETFramework,Version= v4.0" were not found That's a nice explanation, in my case no information is provided about what files are missing.
I think node-gyp is picking the right msbuil platform toolset version (v140):
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(35
6,5): error MSB6006: "CL.exe" salió con el código -1073741515. [C:\GBV\GBV_APIL
ocal\node_modules\buffertools\build\buffertools.vcxproj]
In relation to the error code I think you mistook the number, in my case it's -1073741515 (not -1073741819):
-1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND
Someone knows what "STATUS_DLL_NOT_FOUND" stands for?
@Thelmos, you are right I misread the error code (optical illusion?).
I think node-gyp is picking the right msbuil platform toolset version (v140):
I saw that and thought might still make sense what happens if first hand 14.0 msbuild.exe is used instead of v4.0 delegating v14 toolset. Most probably the error would be same as you suspected, but can't say for certain unless the solution is tested.
while i'm can't be sure which part helped for me, i'll tell what i did anyways (as far as i remember) (win 8.1)
(uninstalled some stuff)
installed the build tool 2015 preview
installed sdk 8.1
npm cache clean; rm -rf /node_modules
(x) installed ms c++ compiler package for python 2.7
(x) run that c:Program Files (x86)Microsoft Visual Studio 14.0VCvcvarsall.bat
installed nodejs 5.4.1
npm config -g set msvs_version 2013 (yes 2013 !!, 2015 didn't work for me !?)
and then i did get kerberos compiled
(x) needed? i don't know
8 hours with no success on Windows 10
This is a pain in the ass!
I tried a lot and tried to get to work healthy-gulp-angular
No chance!!!
Hey everyone, thank you so much for all the awesome feedback on the Visual C++ Build Tools so far!
As has been mentioned earlier in this thread... there were some inconsistencies in the install experience of the VC++ build tools. Some folks - namely @hfinger, @dKab, @krave1986 - were running into issues during default install, whereas many others were not. These issues were often solved by selecting custom install and installing both SDKs.
At first, I was very confused because I had tested on several clean configs, but never ran into the issue. But I finally got a chance to dig into those issues and also chat with some VC++ folks internally, so just wanted to update you all on what I learned and provide a little more clarity.
The default install installs the full Windows 8.1 SDK and a partial Windows 10 SDK. Namely, the following components are installed from each...
Now when the tools were initially released (CTP1), the default install worked fine, but the custom installs had some oddities. However, in the meantime, and this is what I missed... we released a CTP2. Unfortunately CTP2 has broken some things in the installer for the default install. Rather than installing version 10.0.10240.0 of the Windows 10 SDK, it is errantly installing version 10.0.10150.0. Now this, by itself would not be an issue. But the corresponding lib, include, etc. paths point to 10.0.10240.0. This results in those errors some people were seeing about being unable to find ucrt components like stddef.h.
And so, the new guidance - for the time being - is to choose Custom Install and select _both_ SDKs, and rest assured this issue will be fixed for RTM (or you can copy and rename the 10.0.10150.0 folders to 10.0.10240.0.) Please let me know if this does _not_ work for you and if additional steps are required, so we can try to fix by RTM.
Additionally, it appears that there's some difficulty in diagnosing the source of node-gyp issues in general (many of the issues brought up in this thread are not actually Windows-specific). In testing the VC++ build tools, I ran into many of these myself, so here's a table that should hopefully help diagnose these cryptic compiler errors in the future:

This table is also available in our new Node.js Guidelines repo, so please feel free to make PRs and generally engage with us there if you have any ideas for useful additions: https://github.com/microsoft/nodejs-guidelines
Next steps:
I'll be updating the instructions in my original post to reflect these changes, will test with a few more configurations, and will be submitting a PR to the README with simplified instructions for _both_ the new VC++ Build Tools and VS2015. After that, I propose we close this issue and spin further discussions off into separate issues because this one is getting a bit overloaded. Thoughts?
Just as a general note, related to the build tools + specifically node-gyp with my system.
I don't feel I'm that unusual to be a developer on a windows machine with VS2010, VS2012 and VS2015 installed, I don't think I'm that unusual as a python developer to have Python 2.7.4 x86, Python 2.7.10 x86/64, Python 3.4.6 and Python 3.5.2 x64 installed either. Python in all these cases has no problem in finding the right compiler for itself in the registry and building its own compiler environment.
The app I am working on has a Flask backend based on Python 3, and it uses some Python libraries with binary dependencies such as lxml which compile with whatever C Runtime is correct for the version of python which is executing.
I have a gui based on Electron, and it has some tooling which depends on node-gyp as a dev dependency (supposed to make my life easier).
Given that the vast dependency tree needed for node_gyp is installed on my machine through the normal route and fully enabled in the registry, python is able to find whichever MSVC compiler it wants through it's own standard library (python 2.7 distutils can find the VS2013 compiler no problem). I have to do a truly painful environment switch mid build, not just re-ordering path variables but, exiting my virtualenv trimming specific directories out of PATH/LIB/INCLUDE so that the node_gyp step can execute. Maintaining the environment is work genuine as patches and updates will do updates to the environment that have to be unset.
Generating vcproj in python seems strange, when you could just generate a call to distutils.setup and leave all the donkey work to python and is already is needed and capable of doing the whole task. I have a build process which I would find hard to explain to Linus Torsvalds in order to basically do nothing unusual.
Hi all, finally I give up ... lots of tries with paths, environment cmd files, SDKs, ...
I cant make Visual C++ Build Tools 2015 work in my Windows7 so I installed Visual Studio 2013 Express and all worked like a charm in first try.
Thanks all people here for the help provided, I'll check this issue periodically expecting some final "working for all" solution.
Glad I found this thread! Thank you everyone! You're the Real Mvps!
Meteor 1.2.1 uses node v0.10.40 and npm v1.4.9 internally and after 15GB+ of installations, it has failed to work...
I'm trying to run https://github.com/lovell/sharp using meteorhacks:npm and there's always a Your application has errors. Waiting for file change. staring at my face.
Oh my god, I'm so sick of this nodegyp bullshit. It seemed I solved this problem last time, but now I'm trying to install another project and here we go again. This is so infuriating!
C:Falconpres-schedulenode_modulesbufferutil>if not defined npm_config_node_gyp (node "C:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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.
bufferutil.cc
C:Falconpres-schedulenode_modulesnannan.h(263): error C2995: 'v8::Local
C:Falconpres-schedulenode_modulesnannan.h(256): note: see declaration of '_NanEnsureLocal'
C:Falconpres-schedulenode_modulesnannan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(661): error C2039: 'FreeCallback': is not a member of 'node' [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_object_wrap.h(8): note: see declaration of 'node'
C:Falconpres-schedulenode_modulesnannan.h(661): error C2061: syntax error: identifier 'FreeCallback' [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(665): error C2065: 'callback': undeclared identifier [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(665): error C2065: 'hint': undeclared identifier [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(672): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(43): note: could be 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,char *,size_t)'
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(31): note: or 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
C:Falconpres-schedulenode_modulesnannan.h(672): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:Falconpres-schedulenode_modulesnannan.h(676): error C2440: 'return': cannot convert from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(676): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:Falconpres-schedulenode_modulesnannan.h(683): error C2039: 'Use': is not a member of 'node::Buffer' [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(8): note: see declaration of 'node::Buffer'
C:Falconpres-schedulenode_modulesnannan.h(683): error C3861: 'Use': identifier not found [C:Falconpres-schedulenode_modulesbufferutilbuildbufferutil.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:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibbuild.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:Program Filesnodejsnode.exe" "C:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd C:Falconpres-schedulenode_modulesbufferutil
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
[email protected] install C:Falconpres-schedulenode_modulesutf-8-validate
node-gyp rebuild
C:Falconpres-schedulenode_modulesutf-8-validate>if not defined npm_config_node_gyp (node "C:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-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:Falconpres-schedulenode_modulesnannan.h(263): error C2995: 'v8::Local
C:Falconpres-schedulenode_modulesnannan.h(256): note: see declaration of '_NanEnsureLocal'
C:Falconpres-schedulenode_modulesnannan.h(661): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(661): error C2039: 'FreeCallback': is not a member of 'node' [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_object_wrap.h(8): note: see declaration of 'node'
C:Falconpres-schedulenode_modulesnannan.h(661): error C2061: syntax error: identifier 'FreeCallback' [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(665): error C2065: 'callback': undeclared identifier [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(665): error C2065: 'hint': undeclared identifier [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(672): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(43): note: could be 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,char *,size_t)'
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(31): note: or 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)'
C:Falconpres-schedulenode_modulesnannan.h(672): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:Falconpres-schedulenode_modulesnannan.h(676): error C2440: 'return': cannot convert from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:Falconpres-schedulenode_modulesnannan.h(676): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:Falconpres-schedulenode_modulesnannan.h(683): error C2039: 'Use': is not a member of 'node::Buffer' [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.vcxproj]
C:UsersDmitry_Kabardinov.node-gyp4.2.3includenodenode_buffer.h(8): note: see declaration of 'node::Buffer'
C:Falconpres-schedulenode_modulesnannan.h(683): error C3861: 'Use': identifier not found [C:Falconpres-schedulenode_modulesutf-8-validatebuildvalidation.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:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibbuild.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:Program Filesnodejsnode.exe" "C:UsersDmitry_KabardinovAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js" "rebuild"
gyp ERR! cwd C:Falconpres-schedulenode_modulesutf-8-validate
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: node-gyp rebuild
npm WARN install:[email protected] Exit status 1
What am I supposed to do now? I already installed both SDKs - that's what helped me last time. I still have them. What can I do now, to make npm install work??
@dKab That error has nothing to do with node-gyp. It looks like you're trying to install a version of bufferutil / utf-8-validate that is using an outdated version of nan. Latest version of utf-8-validate is 1.2.1, try installing that.
@dKab maybe you should update to latest node version as well. Last time I did an update and build errors went away.
And people please, use Gist, attached files or similar services instead of copy full of compile output on here.
How much disk space does this VS crap (sorry) actually require? The install splash screen claims 4GB.

Note also how you can't disable the greyed out Join the Visual Studio Experience Improvement program.
@mousetraps Did you mean 10.0.10150.0, not 10.10150.0?
@galeksandrp yes, good catch - fixed in my comment :smiley:
@dandv not sure about the specifics of the installer, but I presume that the size on disk also includes some setup caching. and as mentioned above, future releases should not require you to select the full Windows 10 SDK. re: experience improvement program - this is standard practice for our technical preview builds. RTM will offer this option.
@dandv You can try Default install, which is uses less space because installs only ucrt part of Windows 10 SDK, and then create symlinks, IWFM.
mklink /d "%ProgramFiles(x86)%\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.UniversalCRT.Debug\10.0.10240.0" "%ProgramFiles(x86)%\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.UniversalCRT.Debug\10.0.10150.0"
mklink /d "%ProgramFiles(x86)%\Windows Kits\10\Include\10.0.10240.0" "%ProgramFiles(x86)%\Windows Kits\10\Include\10.0.10150.0"
mklink /d "%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.10240.0" "%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.10150.0"
mklink /d "%ProgramFiles(x86)%\Windows Kits\10\Source\10.0.10240.0" "%ProgramFiles(x86)%\Windows Kits\10\Source\10.0.10150.0"
NPM update is not necessary for using npm config set msvs_version or GYP_MSVS_VERSION.
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 /v 14.0 /t REG_EXPAND_SZ /d ^%programfiles(x86)^%"\Microsoft Visual Studio 14.0\\"
Open up a GIT CMD window and run npm install node-gyp It needs the GIT commands to clone properly, assuming all other components have been installed and are correctly in your path.
So here is a question. I needed to uninstall Visual Studio 2015 in order to install the fixes for this problem.
Now I have VS in my App list and appear to have some left over directories in Program Files (86) but no Common Tools folder error found on attempts to start VS.
Is it Node or VS, neither the twain shall meet or can VS 2015 be reinstalled when, if i ever need it?
Thanks
@cloidjgreen - please see the instructions in our node guidelines repo for updated VS install steps. There is also a PR open to update the node-gyp readme with these simplified steps.
Thank you,
Seemed to work perfectly
On Thu, Feb 4, 2016 at 1:45 PM, Sara Itani [email protected] wrote:
@cloidjgreen https://github.com/cloidjgreen - please see the
instructions in our [node guidelines repo] for updated VS install steps (
https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#prerequisites).
There is also a PR open to update the node-gyp readme with these simplified
steps.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node-gyp/issues/629#issuecomment-180019690.
Cloid John Green
In addition to @mousetraps comment, this other comment also helped me to make it work.
Hi
To ease the pain for the developers at our firm, I've started a repo that can check the local system for missing dependencies and report back with humanly understandable error messages for when dependencies aren't sufficient for node-gyp (the concept is heavily inspired by yeoman doctor)
I'm not entirely sure of how I'm going to crack the nut of writing a test that can point out a missing Visual C++ installation. Do you people have any input on how to write that test? Should I look in the registry? Other things? Any input is appreciated.
@teltploek Does your firm allow open source development? Such a repo would definitely be useful to the Windows Node community. I imagine that you're also more likely to get contributions.
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/
i think above site could be helpful
Work for me!!!!
1- Install VC++ Build Tools Technical Preview, choose Custom Install, and select both Windows 8.1 and Windows 10 SDKs.
2- Install Python 2.7, and add it to your PATH
3- npm config set python python2.7
4- npm config set python C:Python27python.exe
5- set VCTargetsPath=C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140
Thank a lot @mousetraps
@mousetraps thanks for your work on this! :)
A question - will the RTM version of the Build Tools installer also let me specify where it will install and take up the 4-7 GB of space? It'd be great if there was an option that would take as little space on the C: drive as possible, ideally zero.
My 60GB SSD that I use as the system disk is already pushed to its limits by numerous applications that refuse to be installed anywhere else :)
So it effectively means 7GB of dependencies to install https://github.com/lovell/sharp.
I'm going back to tool using ImageMagick (70MB)
@piotr-cz Use sharp in production environment, it's much faster and more reliable.
I wanted to use it in gulp build script to process images.
Anyway they may use node-pre-gyp in future (https://github.com/lovell/sharp/issues/186).
Apparently sharp should contain pre-compiled binaries for Windows since v0.12, but somehow during installation it's trying to build these anyway.
I have VS2015 installed and solution I've found is to run "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" to setup env variables in cmd shell.
OMG!
extract:ws → gunzTarPerm ▄ ╢████████████████████████extract:ws → gunzTarPerm ▄ ╢████████████████████████extract:ws → gunzTarPerm ▀ ╢████████████████████████extract:redis → gunzTarPe ▐ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:socket.io → gunzT ▌ ╢████████████████████████extract:socket.io → gunzT ▀ ╢████████████████████████extract:uglify-js ▀ ╢████████████████████████ extract:socket.io-client ▀ ╢████████████████████████ extract:zeparser ▀ ╢████████████████████████ finalize:zeparser → final ▐ ╢████████████████████████install ▐ ╢████████████████████████
[email protected] install G:Programnodechatroomnode_modulesws
(node-gyp rebuild 2> builderror.log) || (exit 0)
install:uglify-js ▌ ╢████████████████████████
G:Programnodechatroomnode_modulesws>if not defined npm_config_node_gyp (node "C:Usersrwn1AppDataRoamingnpmnode_modulesnpmbinnode-gyp-bin....node_modulesnode-gypbinnode-gyp.js" rebuild ) else (node rebuild )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
bufferutil.cc
G:Programnodechatroomnode_modulesnannan.h(409): error C2039: 'ExternalAsc
iiStringResource': is not a member of 'v8::String' [G:Programnodechatroomno
de_moduleswsbuildbufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(409): error C2065: 'ExternalAsc
iiStringResource': undeclared identifier [G:Programnodechatroomnode_modules
wsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2065: 'resource':
undeclared identifier [G:Programnodechatroomnode_moduleswsbuildbufferuti
l.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2433: 'NanNew': '_
_forceinline' not permitted on data declarations [G:Programnodechatroomnode
_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2365: 'NanNew': re
definition; previous definition was 'function' [G:Programnodechatroomnode_m
oduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2448: 'NanNew': fu
nction-style initializer appears to be a function definition [G:Programnodec
hatroomnode_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(430): error C2766: explicit spe
cialization; 'v8::Localv8::StringObject NanNew
troomnode_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(420): note: see previous defi
nition of 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(447): error C2995: 'v8::Local
has already been defined [G:Programnodechatroomnode_moduleswsbuildbuffer
util.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(438): note: see declaration o
f 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(459): error C2995: 'v8::Local
has already been defined [G:Programnodechatroomnode_moduleswsbuildbuffer
util.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(450): note: see declaration o
f 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(767): error C3083: 'smalloc': t
he symbol to the left of a '::' must be a type [G:Programnodechatroomnode_m
oduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(767): error C2039: 'FreeCallbac
k': is not a member of 'node' [G:Programnodechatroomnode_moduleswsbuildb
ufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_object_wrap.h(8): note: see d
eclaration of 'node'
G:Programnodechatroomnode_modulesnannan.h(767): error C2061: syntax error
: identifier 'FreeCallback' [G:Programnodechatroomnode_moduleswsbuildbuf
ferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(770): error C2065: 'callback':
undeclared identifier [G:Programnodechatroomnode_moduleswsbuildbufferuti
l.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(770): error C2065: 'hint': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildbufferutil.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(777): error C2665: 'node::Buffe
r::New': none of the 4 overloads could convert all the argument types [G:Progr
amnodechatroomnode_moduleswsbuildbufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(43): note: could be
'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate _,char *,size_t)'
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(31): note: or
'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,v8::Local
G:Programnodechatroomnode_modulesnannan.h(777): note: while trying to m
atch the argument list '(v8::Isolate *, const char *, uint32_t)'
G:Programnodechatroomnode_modulesnannan.h(781): error C2440: 'return': ca
nnot convert from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' [G:P
rogramnodechatroomnode_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(781): note: No constructor co
uld take the source type, or constructor overload resolution was ambiguous
G:Programnodechatroomnode_modulesnannan.h(788): error C2039: 'Use': is no
t a member of 'node::Buffer' [G:Programnodechatroomnode_moduleswsbuildbu
fferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(8): note: see declar
ation of 'node::Buffer'
G:Programnodechatroomnode_modulesnannan.h(788): error C3861: 'Use': ident
ifier not found [G:Programnodechatroomnode_moduleswsbuildbufferutil.vcxp
roj]
G:Programnodechatroomnode_modulesnannan.h(1728): error C2039: 'IsExternal
Ascii': is not a member of 'v8::String' [G:Programnodechatroomnode_modules
wsbuildbufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1729): error C2039: 'ExternalAs
ciiStringResource': is not a member of 'v8::String' [G:Programnodechatroomn
ode_moduleswsbuildbufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1729): error C4430: missing typ
e specifier - int assumed. Note: C++ does not support default-int [G:Programn
odechatroomnode_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1729): error C2143: syntax erro
r: missing ';' before '_' [G:Programnodechatroomnode_moduleswsbuildbuffe
rutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1729): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildbufferutil.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1730): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildbufferutil.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1730): error C2039: 'GetExterna
lAsciiStringResource': is not a member of 'v8::String' [G:Programnodechatroo
mnode_moduleswsbuildbufferutil.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1731): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildbufferutil.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1731): error C2227: left of '->
data' must point to class/struct/union/generic type [G:Programnodechatroomn
ode_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1731): note: type is 'unknown
-type'
G:Programnodechatroomnode_modulesnannan.h(1732): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildbufferutil.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1732): error C2227: left of '->
length' must point to class/struct/union/generic type [G:Programnodechatroom
node_moduleswsbuildbufferutil.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1732): note: type is 'unknown
-type'
validation.cc
G:Programnodechatroomnode_modulesnannan.h(409): error C2039: 'ExternalAsc
iiStringResource': is not a member of 'v8::String' [G:Programnodechatroomno
de_moduleswsbuildvalidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(409): error C2065: 'ExternalAsc
iiStringResource': undeclared identifier [G:Programnodechatroomnode_modules
wsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2065: 'resource':
undeclared identifier [G:Programnodechatroomnode_moduleswsbuildvalidatio
n.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2433: 'NanNew': '_
_forceinline' not permitted on data declarations [G:Programnodechatroomnode
_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2365: 'NanNew': re
definition; previous definition was 'function' [G:Programnodechatroomnode_m
oduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(409): error C2448: 'NanNew': fu
nction-style initializer appears to be a function definition [G:Programnodec
hatroomnode_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(430): error C2766: explicit spe
cialization; 'v8::Localv8::StringObject NanNew
troomnode_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(420): note: see previous defi
nition of 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(447): error C2995: 'v8::Local
has already been defined [G:Programnodechatroomnode_moduleswsbuildvalida
tion.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(438): note: see declaration o
f 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(459): error C2995: 'v8::Local
has already been defined [G:Programnodechatroomnode_moduleswsbuildvalida
tion.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(450): note: see declaration o
f 'NanNew'
G:Programnodechatroomnode_modulesnannan.h(767): error C3083: 'smalloc': t
he symbol to the left of a '::' must be a type [G:Programnodechatroomnode_m
oduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(767): error C2039: 'FreeCallbac
k': is not a member of 'node' [G:Programnodechatroomnode_moduleswsbuildv
alidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_object_wrap.h(8): note: see d
eclaration of 'node'
G:Programnodechatroomnode_modulesnannan.h(767): error C2061: syntax error
: identifier 'FreeCallback' [G:Programnodechatroomnode_moduleswsbuildval
idation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(770): error C2065: 'callback':
undeclared identifier [G:Programnodechatroomnode_moduleswsbuildvalidatio
n.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(770): error C2065: 'hint': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildvalidation.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(777): error C2665: 'node::Buffe
r::New': none of the 4 overloads could convert all the argument types [G:Progr
amnodechatroomnode_moduleswsbuildvalidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(43): note: could be
'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate _,char *,size_t)'
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(31): note: or
'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,v8::Local
G:Programnodechatroomnode_modulesnannan.h(777): note: while trying to m
atch the argument list '(v8::Isolate *, const char *, uint32_t)'
G:Programnodechatroomnode_modulesnannan.h(781): error C2440: 'return': ca
nnot convert from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' [G:P
rogramnodechatroomnode_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(781): note: No constructor co
uld take the source type, or constructor overload resolution was ambiguous
G:Programnodechatroomnode_modulesnannan.h(788): error C2039: 'Use': is no
t a member of 'node::Buffer' [G:Programnodechatroomnode_moduleswsbuildva
lidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodenode_buffer.h(8): note: see declar
ation of 'node::Buffer'
G:Programnodechatroomnode_modulesnannan.h(788): error C3861: 'Use': ident
ifier not found [G:Programnodechatroomnode_moduleswsbuildvalidation.vcxp
roj]
G:Programnodechatroomnode_modulesnannan.h(1728): error C2039: 'IsExternal
Ascii': is not a member of 'v8::String' [G:Programnodechatroomnode_modules
wsbuildvalidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1729): error C2039: 'ExternalAs
ciiStringResource': is not a member of 'v8::String' [G:Programnodechatroomn
ode_moduleswsbuildvalidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1729): error C4430: missing typ
e specifier - int assumed. Note: C++ does not support default-int [G:Programn
odechatroomnode_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1729): error C2143: syntax erro
r: missing ';' before '_' [G:Programnodechatroomnode_moduleswsbuildvalid
ation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1729): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildvalidation.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1730): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildvalidation.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1730): error C2039: 'GetExterna
lAsciiStringResource': is not a member of 'v8::String' [G:Programnodechatroo
mnode_moduleswsbuildvalidation.vcxproj]
C:Usersrwn1.node-gyp4.4.1includenodev8.h(2081): note: see declaration
of 'v8::String'
G:Programnodechatroomnode_modulesnannan.h(1731): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildvalidation.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1731): error C2227: left of '->
data' must point to class/struct/union/generic type [G:Programnodechatroomn
ode_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1731): note: type is 'unknown
-type'
G:Programnodechatroomnode_modulesnannan.h(1732): error C2065: 'ext': unde
clared identifier [G:Programnodechatroomnode_moduleswsbuildvalidation.vc
xproj]
G:Programnodechatroomnode_modulesnannan.h(1732): error C2227: left of '->
length' must point to class/struct/union/generic type [G:Programnodechatroom
node_moduleswsbuildvalidation.vcxproj]
G:Programnodechatroomnode_modulesnannan.h(1732): note: type is 'unknown
-type'
install:uglify-js ▌ ╢████████████████████████ runTopLevelLifecycles ▐ ╢████████████████████████ [email protected] G:Programnodechatroom
├── [email protected]
└─┬ socket.[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└─┬ socket.[email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
└── [email protected]
runTopLevelLifecycles ▐ ╢████████████████████████ npm WARN EPACKAGEJSON [email protected] No repository field.
runTopLevelLifecycles ▄ ╢████████████████████████ npm WARN EPACKAGEJSON [email protected] No license field.
runTopLevelLifecycles ▌ ╢████████████████████████
G:Programnodechatroom>
@Noaiii oh, really, so you still want to pollute this post by your console output. Gist or plenty of paste sharing tools out there should work. Please send us an URL instead of whole bunch f**king log.
@xgenvn try and keep it civil
@TheAlphaNerd
I remember that I request very _sincerely_ not to post every log into this post, and people seem ignoring that. It doesnt make any sense that some solutions have already there and someone because of lacking searching skill or just out of patience, then start throwing the logs into this long long issue. And github isnt designed to optimize for such problem.
I'll keep civil and be nice, but for once I have to tell it the critical and crucial way.
So many different instuctions, tryied a lot of them. Still not working on windows 10.
Thank you @mousetraps for all of your detailed investigation on this issue. Your instructions were almost what I needed. Even after that, though, it still wasn't working for me on Windows 7, but I searched a little more and found @ericgrosse 's instructions , which are what finally worked for me. I needed to give the full path in the npm set config python step.
@luisrudge, what is the expected outcome of this thread? Are we expecting that Microsoft should ship the C++ compiler with Windows, like Linux based OS comes with gcc and BSD likes come with clang? Or are we expecting that package devs should provide precompiled binaries like phantom.js and node-sass?
If the initial expectations haven't been met, can we open a separate Part 2 of this issue and lock this one down (since GitHub has no pagination)?
@jasonwilliams200OK not sure if ironic or not... did you see yesterday's Microsoft announcement about the new linux sub system?
To me the main goal of this thread was to make the experience of getting things to compile on windows not completely non intuitive and painful. I don't think we are quite there yet. I would imagine this thread should be closed when our documentation is updated to make the experience less painful for new devs
I don't think we are quite there yet.
First, what problem are we solving here? I mean, what exactly is the outcome in terms of process improvement concerning node-gyp?
Here is my take on problem:
On Unix,
npm install <some-package-with-c++-module>requires a C++ compiler, unless there is precompiled binary available via custom build process (phantom.js, node-sass etc.). On Windows this is exactly same. The difference is: Windows doesn't have a C++ compiler preinstalled, while most Unix are shipped with one. The pain point for end user is to "install" VS on Windows. This has been somewhat addressed via build tools but the actual pain point of "install a compiler on every machine to consume node.js packages with c++ modules" remains. Anecdotally, some Ruby gems with C++ modules possess the same behavior for users.
Am I correct in elaborating the problem so far?
Second take on solution apart from Microsoft to ship C++ compiler on every Windows box..:
Generally, compiling from source is not a good idea on every machine / install target. Pre-build binaries with checksums/jwt-token for verification (and transparency purposes) is a way to go. There needs to be an infrastructure in place to make it happen, preferably first-hand standard issue by node.js team, and then package maintainers should be encouraged to use that method. node-pre-gyp is just half way there.
@jasonwilliams200OK I think you are close but it can be abstracted one step higher... it is hard to get a working toolchain on windows, and it is not always obvious what is going wrong. This can include the c++ compiler and need to install VS, but can also include problems such as which version of python to install and how to get it in your path correctly.
AFAIK @mousetraps has created an update to our official readme that helps to walk people through it... I tried to dig it up for the original response but couldn't find it. I think the major blocker was making sure the suggested build tool was properly tested in all environments
@TheAlphaNerd, https://github.com/nodejs/node-gyp/pull/867 is what you were looking for I suppose. Hopefully that will be merged soon and give closure to masses (before the comment count on this thread exceed 500)
such as which version of python to install
True. I think python dependency itself is pretty unfortunate when gyp/gn are build-systems of choice, merely on the merits of aligning with Chromium team: https://github.com/nodejs/NG/issues/24#issuecomment-174238318.
@mousetraps would you or anyone on the team be able to investigate Windows builds on https://github.com/JustinTulloss/zeromq.node? I'd like to ship an Electron app with prebuilt bindings for Windows and am fairly flummoxed.
@justrhysism and everyone else:
Sorry I haven't reacted earlier. This is a follow up on this post:
Yes of course we're open to open sourcing it. It's already a repo we've forked a great deal out of :-)
If I'm not able to find a solution, the tool will never be finished, and it will never be able to help anyone.
I've now transferred the ownership of the repo to myself, and you can find it here:
https://github.com/teltploek/doctor
The issue I'm having trouble with it this: Find out it correct version of Visual Studio is installed. Any help anyone could provide would be appreciated.
working for me in Windows 2008 server! thanks @mousetraps!!!
Issue fixed? - Not at all!
After installing SDK and Python I have receive the following message, do I really want to install visual studio?:
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [M:WebsitesEvaluAngularyoangular-full-stacknode_
modulesutf-8-validatebuildbinding.sln]
Sorry for yet another post in an already massive thread- this might be a good one for @luisrudge to capture at the top
I believe I found a workaround for folks having a bad time with VS2015, specifically folks that have that have more than one version installed (or had more than one, but uninstalled it later). Details captured in https://github.com/nodejs/node-gyp/issues/679#issuecomment-211117703
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'
Thanks for the waste of time, migrating the project to python right now.
this issue was fixed??
I tried these steps, step by step: https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/
but often I got similar errors :/.
got hubpress not to run. Will do more research and will check it again...
Got this issue, when I try npm install in a hubpress.io fork:
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` 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:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Projekte\Others\chrizzly.info\node_modules\gulp-jest\node_modules\jest-cli\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
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 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 information on how to open an issue for this project with:
npm ERR! npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
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:\Projekte\Others\chrizzly.info\npm-debug.log
@Chris2011
In Command Prompt:
SET PATH %ProgramFiles(x86)%\msbuild\14.0\bin;%PATH%
npm i contextify
since node-gyp fails to use the _latest_ available msbuild installed on the system..
The other option is to add %ProgramFiles(x86)%\msbuild\14.0\bin to system environment PATH before anything else.
ok let me check, thx.
@jasonwilliams200OK Ok I didn't have the 14.0. I installed it and I added it to the PATH at the very first as you said. Then I tried npm i contextitfy and I got I think the same error:
C:\Projekte\Others\chrizzly.info>npm i contextify
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
|
> [email protected] install C:\Projekte\Others\chrizzly.info\node_modules\contextify
> node-gyp rebuild
C:\Projekte\Others\chrizzly.info\node_modules\contextify>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 )
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
C:\Projekte\Others\chrizzly.info\node_modules\contextify\build\contextify.vcxproj(20,3): error MSB4019: Das importierte Projekt "C:\Microsoft.Cpp.Default.props" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der <Import>-
Deklaration korrekt und die Datei auf dem Datenträger vorhanden ist.
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:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Projekte\Others\chrizzly.info\node_modules\contextify
gyp ERR! node -v v4.4.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "contextify"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
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 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 information on how to open an issue for this project with:
npm ERR! npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
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:\Projekte\Others\chrizzly.info\npm-debug.log
Ok I didn't have the 14.0
Did you install build tools 2015? See the first post of this thread..
Ok I will check this ticket: https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
Very great, that worked :) thx for the hint.
I'm not able to install the build tools 2015 as I already have VS 2015 Update 2 installed. From the horse's mouth:
Note: These components are the same version as the ones installed by the Visual Studio 2015 Update 1 setup. As a result, the C++ Build Tools installer will not run on a machine with Visual Studio 2015 already installed on it. The reverse (i.e. upgrade to Visual Studio) is supported
I am attempting to modify my VS 2015 installation, but I don't see the option for the Windows 8 SDK. Under Windows and Web Development -> Universal Windows App Development Tools I see Windows 10 SDK. I'm on a Windows 7 machine, what else can I do to get the Windows 8 SDK? Must I really uninstall VS to do this?
You can download Windows 8 SDK separately:
https://developer.microsoft.com/en-us/windows/downloads/windows-8-sdk.
The reason for "why Windows 8 SDK is even needed on Windows 10, when Windows 10 SDK is there" is because Win8 SDK is hardcoded in common.gypi file and the gyp official workaround is to manually apply this patch: https://codereview.chromium.org/1247493002/patch/40001/50001.
@jasonwilliams200OK This is buildfile of Chromium browser, not gyp source code.
@galeksandrp, ICYMI, gyp was originally built for chromium by chromium people.
@jasonwilliams200OK, yes, but file from patch you referred is .gypi file, when gyp is written in python. And look, there are references to DirectX SDK in it (which obviously not needed to be used in crossplatform _buildsystem_.
there are references to DirectX SDK in it
@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 ~\.node-gyp\<version>\include\node\common.gypi or node_modules\node-gyp\addon.gypi file to add these dirs (suiting your drive letter and exact version of latest available SDK):
'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:
Make sure you have the latest version of Node. Right now it is v5.11.0 Stable and includes an up-to-date version of npm. Even if you apply legitimate fixes found in this thread, you will still get node-gyp errors using an outdated version of Node or npm.
Use Mousetrap's solution, found here. You don't even need to read her full post, just blindly follow steps 1-4 that she provides.
If you're getting an error ImportError: No module named gyp, it means you need to reconfigure how npm accesses the python shell. The instructions are given here.
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 Visual C++ Build Tools 2015.
As an additional note: I always run npm install from a git bash terminal that's run as administrator.
Confirming that @mousetraps method still works as of the time of writing with no additional steps.
OS: Microsoft Windows 10 Pro N (Build 10586)
Node: 5.11.0
npm: 3.8.6
Notes:
MSB4019, you probably got the wrong one installed.npm config set msvs_version 2015 --globalGYP_MSVS_VERSION, you can unset that.According to @fskreuz if you had this set during your struggle, make sure its updated to the most recent version
SET VCTargetsPath=C:Program Files (x86)MSBUILDMicrosoft.Cppv4.0V120
for me its v140
@barocsi, note that if you have latest msbuild in PATH, then you do not need to set VCTargetsPath:
SET PATH=C:Program Files (x86)MSBUILD14.0Bin;%PATH%
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 vcxproj explicitly or via the MSBuild default .targets.
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. :smile:
Having done the following steps still does not work:
1) Installing Windows10
2) Installing node v.4.4.3 (LTS)
3) Updating npm to 3.8.8
4) Installed python 2.7.11 and added to path
5) Installing "VC++ Build Tools Technical Preview" https://www.microsoft.com/en-us/download/confirmation.aspx?id=49983
6) npm install [email protected]
finally getting this error:
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
xmlparse.c
xmltok.c
xmlrole.c
win_delay_load_hook.c
..\..\..\deps\libexpat\lib\xmlparse.c(5): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory [C:\_js\cme-co
ntent-crawler-suppilo\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
..\..\..\deps\libexpat\lib\xmltok.c(5): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory [C:\_js\cme-cont
ent-crawler-suppilo\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
..\..\..\deps\libexpat\lib\xmlrole.c(5): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory [C:\_js\cme-con
tent-crawler-suppilo\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h(31): fatal error C1083: Cannot open include file: 'ctype.h': No such file or dir
ectory (compiling source file C:\Users\froth\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c) [C:\_js\
cme-content-crawler-suppilo\node_modules\node-expat\build\deps\libexpat\expat.vcxproj]
g
Sorry for spamming more, but is this a node-gyp?
Definitely still not able to build things here without Visual Studio proper.
Installed:
npm config set msvs_version 2015npm config set python pythonTest:
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: https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
@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.
It's not 8GB, it's less than 800mb for just the build tools. You don't need the full SDK.
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 wget'able from here).
For example, in PowerShell:
# 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)
Windows 10 - Pro - 64 bits - FRENCH
Intel Core i7-3770 CPU @ 3.40GHz
16 GB RAM
System 2 (laptop)
Dell XPS 15 9550
Windows 10 - Family - 64 bits - FRENCH
Intel Core i7-6700HQ CPU @ 2.60GHz
16 GB RAM
_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).
I am not claiming any of these steps are the correct ones, but they do reflect the sequence that led to a successful install of the bcrypt npm module (version 0.8.7, as of june 10, 2016)._
STEP 1
Perform full installation of C++ Build Tools 2015 (from: https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/)
(I say full install because this is what I did, however I don't claim that the full install is necessary)
_Note:_ this may take a while as the full program is over 4GB
STEP 2
Install Python 2.7.11 (from: https://www.python.org/)
_Note:_ during installation select the "add to PATH" option (which is not selected by default)
STEP 3
Run:
npm config set msvs_version 2015 --global
_Note:_ I ran it as administrator in Windows cmd.exe
STEP 4
In my NodeJS project folder (a little blog app i am writing to learn NodeJS), I then ran the install command:
npm install bcrypt --save
This is the output I got (**** asterisks are simply used to hide my local project folder path):
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
> [email protected] install D:\**********\blog\node_modules\bcrypt
> node-gyp rebuild
D:\**********\blog\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 )
Génération des projets individuellement dans cette solution. Pour activer la génération en parallèle, ajoutez le commutateur "/m".
blowfish.cc
bcrypt.cc
bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data [D:\**********\blog\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument': conversion from 'ssize_t' to 'unsigned char', possible loss of data [D:\**********\blog\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(229): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\**********\blog\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\**********\blog\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
win_delay_load_hook.c
Creating library D:\**********\blog\node_modules\bcrypt\build\Release\bcrypt_lib.lib and object D:\**********\blog\node_modules\bcrypt\build\Release\bcrypt_lib.exp
Generating code
Finished generating code
bcrypt_lib.vcxproj -> D:\**********\blog\node_modules\bcrypt\build\Release\\bcrypt_lib.node
[email protected] node_modules\bcrypt
+-- [email protected]
+-- [email protected]
I am now able to run bcrypt() commands in my NodeJS app, they turn out something like:
$2a$10$pDJX6lz6QBVatYCC.KiOJ.q6t6uAlKxRsny9tEPiSHTMhNBIhymW2
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! :smile:
Most helpful comment
Hey all, in case you missed it... :smiley:
The config steps with Node.js should now be as follows:
So please give it a spin and send feedback if you're still running into issues or you think any crucial bits are missing. Much thanks to the VC team for pulling this off!! :smiley: +@mluparu
I've tested it with Node.js and many of the most popular / representative packages. This includes the following packages, as suggested by @am11.
Note that there are still many other things that can go wrong when dealing with native modules - e.g. platform and compiler differences, incompatibilities with architecture, Node version, missing prerequisites (and unfortunately most packages don't provide the best indication of how and where to get those prereqs). One tool that's very helpful in debugging missing prerequisites on Windows is Dependency Walker.
BTW I'll be in SF next week giving a talk on Node.js + Windows, so definitely swing by if you're in the area, and want to chat further: https://www.eventbrite.com/e/nodejs-and-npm-for-the-windows-developer-tickets-19280683042