1

I am wondering if there's a way to get Node to provide a more useful message about which module I might be missing in a C++ n-api node addon.

Here's the error:

PS C:\Users\digit\Desktop\workspace\addons\endec> node .\index.js --client
internal/modules/cjs/loader.js:840
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\C:\Users\digit\Desktop\workspace\addons\endec\build\Debug\testaddon.node

In this case, testaddon.node exists but it's dependent on a shared library (.dll) to run. Is there a way to debug and see what shared lib is missing?

If I add all the shared libs necessary, it works fine.

Sometimes, it's missing one and it can be tough to know which one I should be looking for.

Suhail Doshi
  • 716
  • 1
  • 10
  • 23
  • `process` is a global object so maybe you could try adding a debugging console.log inside the dlopen function? – Aplet123 Apr 30 '19 at 01:12

0 Answers0