agnat / node_mdns

mdns/zeroconf/bonjour service discovery add-on for node.js

Home Page:http://agnat.github.com/node_mdns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The specified procedure could not be found

RichardFoss opened this issue · comments

I can't resolve this issue on Windows. My code works fine on my Macbook. The error appears when the require is executed:
mdns = require('mdns');
I have the Bonjour SDK installed (and restarted Windows), and the environment variable is in place. There is an indication that the problem appears at line 35 of dns_sd.js where the following code appears:

if (ex.code === 'MODULE_NOT_FOUND') {
module.exports = require(product(default_dir));
console.warn('dns_sd: failed to load requested ', buildtype, 'build. using', default_dir, 'instead.');
} else {
throw ex;
}

I find it hard to figure what the issue might be. I have rebuilt the mdns module using nw-gyp from the mdns directory. I am using node.js v12.12.0 and npm v6.11.3
Possibly a missing dll?


Uncaught Error: The specified procedure could not be found.
\?\D:\Git-Repos\ImmerGo-MOTU\immergo-motu\node_modules\mdns\build\Release\dns_sd_bindings.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1048:18)
at Module.load (internal/modules/cjs/loader.js:836:32)
at Function.Module._load (internal/modules/cjs/loader.js:748:14)
at Module.require (internal/modules/cjs/loader.js:873:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (D:\Git-Repos\ImmerGo-MOTU\immergo-motu\node_modules\mdns\lib\dns_sd.js:24:20)
at Module._compile (internal/modules/cjs/loader.js:980:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1003:10)
at Module.load (internal/modules/cjs/loader.js:836:32)
at Function.Module._load (internal/modules/cjs/loader.js:748:14)

Please don’t double-post your issues.

I find it hard to figure what the issue might be.

Hehe... difficult for you, virtually impossible for everyone else. It’s a local issue.

One thing jumps the eye, though. You say you use node v12.12.0. Yet you use nw-gyp, a node WebKit specific tool, to build the add-on. That’s not good.

Possibly a missing dll?

Worse. It’s an incompatible DLL. The most common cause is chaos. To many different versions of node/node webkit/electron/visual studio on the same system; too much stuff in PATH; A major clean-up often does it.

Last, you could try to actually debug it. Using the Visual Studio debugger it is possible to monitor the loaded DLLs and to understand what’s happening. This requires an understanding of node and windows internals.

Thanks for your comment!

Please don’t double-post your issues.

My apologies, I initially commented on a 2017 issue, and subsequently thought that my comment was more of a new issue.

you use nw-gyp, a node WebKit specific tool,

I assumed that I would have to use nw-gyp to build mdns if I am using nw for my application?

To many different versions of node/node webkit/electron/visual studio on the same system

I'm just using node version 12.12.0 and nw version 0.41.3. I'm not using Electron. I'm using Visual Studio 2017.
My application is a client/server immersive sound system that interacts with wireless clients and Ethernet AVB speakers. I have had no issues with any of the many node modules (cap and MIDI both have required nw-gyp). I needed to port my system to MOTU devices that can be discovered by Bonjour. mdns has worked well on the Mac, so it was surprising that with the same code, I had a problem on Windows.

Last, you could try to actually debug it.

Thanks for the suggestion. Do you know of any dlls that might be causing the issue?
Thanks for the help!

I’m sorry, but I don’t support nw or electron related issues. I only support node.js. Electron and nw embed their own versions of the node engine and they have their own issues.

Try this: Using vanilla node.js run require(“mdns”) after building the add-on with vanilla node-gyp. See? That works.

Not sure if any of this is helpful but here is a list of mdns issues mentioning nw-gyp.

Thanks for this list! Very helpful to see what others have tried. I'm going to go back to nw-gyp documentation and see that I have everything in place. I will provide details if I find a solution.