dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
127 stars 45 forks source link

ERR_DLOPEN_FAILED after successful npm -i #58

Closed crossan007 closed 1 year ago

crossan007 commented 1 year ago

Trying to run the m-jpeg-streamer after a successful build / install (I was fighting with #46 for a while), I'm now getting this error:

 node .\server.js
node:internal/modules/cjs/loader:1189
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.

Platform: Windows 10 Node v16.15.1

crossan007 commented 1 year ago

Sysinternals' ProcessMonitor indicates that the Node runtime can't find a few DLLs while attempting to require("gstreamer-superficial")

The "Result" for trying to load these DLLs is:

NAME NOT FOUND
Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a

Specifically:

After it fails to find these DLLs within the build/Release folder, it looks through all files in the path (and fails as well): image

I'm guessing that either:

crossan007 commented 1 year ago

Ugh.

messed up PATH strikes again.

The sought after DLLs here were readily available at C:\gstreamer\1.0\msvc_x86_64\bin; however, the above screenshot indicates NodeJS was attempting to load them from C:\gstreamer\1.0\x86_64\bin (among other locations).

For some reason, changes to the PATH variable in my system config weren't taking effect for the terminal session in which I was running Node, so despite my efforts to add the right location to the PATH ( C:\gstreamer\1.0\msvc_x86_64\bin), the script was still failing.

I eventually just ran this PowerShell to update PATH in my current terminal session and that allowed it to work:

$env:path+="C:\gstreamer\1.0\msvc_x86_64\bin;"
dfischer23 commented 1 year ago

thank you for documenting this for others :)

crossan007 commented 1 year ago

"copyable" terminal bits

$env:path+="C:\gstreamer\1.0\msvc_x86_64\bin;"
$env:GSTREAMER_1_0_ROOT_MSVC_X86_64="C:\gstreamer\1.0\msvc_x86_64\"