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

Problem with usage in Electron on windows #158

Open
sebakerckhof opened this issue Feb 23, 2016 · 4 comments
Open

Problem with usage in Electron on windows #158

sebakerckhof opened this issue Feb 23, 2016 · 4 comments

Comments

@sebakerckhof
Copy link

When I try to use this package in Electron on windows (maybe also other platforms, didn't test it) I get the following error:

Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\seba\Dropbox\pairingtool\node_modules\mdns\build\Release\dns_sd_bindings.node
    at Error (native)
    at process.module.(anonymous function) [as dlopen] (ATOM_SHELL_ASAR.js:159:20)
    at Object.Module._extensions..node (module.js:450:18)
    at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:159:20)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\seba\Dropbox\pairingtool\node_modules\mdns\lib\dns_sd.js:24:20)
    at Module._compile (module.js:425:26)

Here's an example repository: https://github.com/sebakerckhof/electron-problem
Just requiring the module already gives me this error ( https://github.com/sebakerckhof/electron-problem/blob/master/src/preload.js#L1 ).

@y-lohse
Copy link
Contributor

y-lohse commented Feb 24, 2016

I think it's the same issue than this one. The error message at least seems to be the same.

@gabrielstuff
Copy link

Not exactly :) when running in electron, you need to native compile mdns and use node-gyp to recompile it with the Atom header.
So open a terminal and run :
npm install -g node-gyp

Then go in your project folder, and in you node_modules/mdns folder. So you should have something like :
cd c:\sources\myproject\nodes_modules\mdns

Then follow the guidelines here : https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md and run :
node-gyp rebuild --target=0.35.0 --arch=x64 --dist-url=https://atom.io/download/atom-shell

And then you'll be happy !

@sebakerckhof
Copy link
Author

Yeah, my bad, I upgraded to win10 and node-gyp broke.
Anyway, I just did a fresh install on win7

I ran .\node_modules\.bin\electron-rebuild.cmd without issues, but if I then try to run node-gyp rebuild --target=0.36.8 --arch=x64 --dist-url=https://atom.io/download/atom-shell. I get:

gyp: binding.gyp not found (cwd: D:\barco\repositories\mvptool) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\seke\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:305:16)
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:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\seke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=0.36.8" "--arch=x64" "--dist-url=https://atom.io/download/atom-shell"
gyp ERR! cwd D:\barco\repositories\mvptool
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok

If I try to run the program I do get a different error, namely:
, where I had it working in the past and now I get this error:

The system cannot find message text for message number 0x%1 in the message file for %2.
\\?\D:\barco\repositories\mvptool\node_modules\mdns\build\Release\dns_sd_bindings.node
 at Error (native)
    at process.module.(anonymous function) [as dlopen] (ATOM_SHELL_ASAR.js:159:20)
    at Object.Module._extensions..node (module.js:450:18)
    at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:159:20)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (D:\barco\repositories\mvptool\node_modules\mdns\lib\dns_sd.js:32:22)
    at Module._compile (module.js:425:26)

@sabrehagen
Copy link

@sebakerckhof Have you tried rebuilding mdns? It's having trouble with the precompiled binary supplied in the package.

Try:

cd node_modules/mdns
node-gyp rebuild --target=1.6.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell

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