Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on Win10 #147

Closed
black-snow opened this issue Dec 10, 2015 · 14 comments
Closed

Installation fails on Win10 #147

black-snow opened this issue Dec 10, 2015 · 14 comments

Comments

@black-snow
Copy link

Hi,

I'm trying to npm install -save mdns on a Windows 10 32-bit machine. After installing python 2.7+, bonjour sdk and setting BONJOUR_SDK_HOME I'm stuck with an error that google won't help me fix.

C:\Users\developer\Desktop\myapp\resources\node_modules\mdns\node_modules\nan\nan.h(28):
fatal error C1083: Datei (Include) kann nicht geöffnet werden: "algorithm": No such file or direc
tory (Quelldatei wird kompiliert ..\src\dns_service_ref_deallocate.cpp) [C:\Users\developer\Deskt
op\myapp\resources\node_modules\mdns\build\dns_sd_bindings.vcxproj]

and

C:\Program Files\Windows Kits\8.1\Include\um\windows.h(160): fatal error C1083: Datei (Include) k
ann nicht geöffnet werden: "excpt.h": No such file or directory (Quelldatei wird kompiliert ..\sr
c\dns_service_register.cpp) [C:\Users\developer\Desktop\myapp
Uploading npm-debug.log…
\resources\node_modules\mdns
\build\dns_sd_bindings.vcxproj]

Probably I'm just too new to node and that stuff and it's an easy fix. I'm trying to npm install this in my resources folder of my electron app.

npm-debug.txt

@black-snow
Copy link
Author

Interesting; on a 2nd run there seem to be other issues:

npm-debug.txt

@agnat
Copy link
Owner

agnat commented Dec 11, 2015

The error happens in NAN and it fails to include a standard header. That should not happen. I just published a new version v2.2.11 that uses latest NAN. Maybe that helps.

If it still doesn't work, try running it from a Visual Studio Command Prompt instead of the "normal" dos box.

I'm trying to npm install this in my resources folder of my electron app.

Usually npm will install packages to $package_root/node_modules/. But I'm not familiar with electron apps. However, I do recall that building native add-ons like mdns using atom (which seems related?) always was a bit tricky. So, to rule out electron specific issues, maybe try it with standard node first?

Unfortunately on windows npm-debug.txt does not contain the actual error messages. It only tells us that the build failed. So, not sure about the second thing.

I don't have the OS at hand. So, all I can do is poke around... Hope this helps.

@black-snow
Copy link
Author

Here's what happens on a blank project (after npm init):

C:\Users\developer\Desktop\test>npm install --save mdns
npm WARN package.json test@1.0.0 No description
npm WARN package.json test@1.0.0 No repository field.

npm WARN package.json test@1.0.0 No README data

mdns@2.2.11 install C:\Users\developer\Desktop\test\node_modules\mdns
node-gyp rebuild

C:\Users\developer\Desktop\test\node_modules\mdns>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.
dns_sd.cpp
dns_service_browse.cpp
dns_service_enumerate_domains.cpp
dns_service_get_addr_info.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_get_addr_info.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build
\dns_sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_sd.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_bindings.vc
xproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_browse.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd
bindings.vcxproj]
dns_service_process_result.cpp
dns_service_ref.cpp
dns_service_ref_deallocate.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_enumerate_domains.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\b
uild\dns_sd_bindings.vcxproj]
dns_service_ref_sock_fd.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_ref.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_bi
ndings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_ref_deallocate.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\buil
d\dns_sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_process_result.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\buil
d\dns_sd_bindings.vcxproj]
dns_service_register.cpp
dns_service_resolve.cpp
mdns_utils.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_ref_sock_fd.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\d
ns_sd_bindings.vcxproj]
network_interface.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_register.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns

sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\dns_service_resolve.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_s
d_bindings.vcxproj]
socket_watcher.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\network_interface.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_
bindings.vcxproj]
txt_record_ref.cpp
txt_record_create.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\mdns_utils.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_binding
s.vcxproj]
txt_record_deallocate.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\socket_watcher.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_bin
dings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_ref.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_bin
dings.vcxproj]
txt_record_set_value.cpp
txt_record_get_length.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_create.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns_sd_
bindings.vcxproj]
txt_record_buffer_to_object.cpp
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_deallocate.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns
_sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_get_length.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns
sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_set_value.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\build\dns

sd_bindings.vcxproj]
c:\users\developer\desktop\test\node_modules\mdns\src\mdns.hpp(32): fatal error C1083: Datei (Inc
lude) kann nicht geöffnet werden: "dns_sd.h": No such file or directory (Quelldatei wird kompilie
rt ..\src\txt_record_buffer_to_object.cpp) [C:\Users\developer\Desktop\test\node_modules\mdns\bui
ld\dns_sd_bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files\MSBuild\14.0\bin\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: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 Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\developer\Desktop\test\node_modules\mdns
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--save" "mdns"
npm ERR! node v4.2.3
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\developer\Desktop\test\npm-debug.log

I'll try using the visual studio command line.

@black-snow
Copy link
Author

Output is the same with VS command prompt.

@black-snow
Copy link
Author

I switched from node 4.x to 5.3 (npm 2.x to 3.3.12) - didn't help :(

Tried downloading dns_sd.h from http://www.opensource.apple.com/source/mDNSResponder/ but I don't know where to put it. Putting it in BONJOUR_SDK_HOME didn't help. Putting it into mdns src didn't help.

@agnat
Copy link
Owner

agnat commented Dec 21, 2015

Datei (Include) kann nicht geöffnet werden: "dns_sd.h"

The compiler can not find the bonjour headers.

@black-snow
Copy link
Author

Ha, after reinstalling bonjour sdk it seems to work - give me a second to actually test it.

@black-snow
Copy link
Author

Alright, we're getting closer.
error

Uncommenting the line from dns_sd.js outputs: 4 1 1 'Release' 'Release'
The path that product(type) returns is ..\build\Release\dns_sd_bindings - there's 3 files in the Release directory: dns_sd_bindings.exp, dns_sd_bindings.map and dns_sd_bindings.node

@black-snow
Copy link
Author

Seems to be related to electron/rebuild#37

@black-snow
Copy link
Author

electron-rebuild didn't fix the issue :( - not sure whom to ask for help ...

@agnat
Copy link
Owner

agnat commented Dec 21, 2015

Summoning @y-lohse. Any thoughts on this?

@black-snow
Copy link
Author

Got it running on my home machine (Win7 x64) with vanilla node.
@agnat So this might rather be an issue with electron.

@gabrielstuff
Copy link

Hi there,

We've managed to build on electron. Here is the step to make it work. On the other hand :) we have an issue packing the app and distribute it there.

  1. Install python 27 and add it to your PATH : https://www.python.org/download/releases/2.7/
  2. Install node 4.3.1 : https://nodejs.org/dist/v4.3.1/node-v4.3.1.pkg
  3. Install Visual Studio Express (fear the faint)
  4. run with customize install
  5. select C++ (by default only Web is include)
  6. Install Bonjour SDK for windows https://developer.apple.com/downloads/?q=Bonjour%20SDK%20for%20Windows
  7. Reboot (you always need to reboot, it is windows ¯_(ツ)_/¯)

Then you can npm install mdns

@Tarnadas
Copy link

I cannot believe, that I had to reinstall Bonjour SDK to make it work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants