justadudewhohacks/opencv4nodejs

opencv4nodejs to .exe executable file

Opened this issue · 1 comments

I try to compile opencv4nodejs to .exe (on windows) with pkg. My question is how can i require opencv4nodejs.node file in my project correctly in order to avoid this error:

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

Error: The specified module could not be found.
\\?\C:\Users\Winexcel\Desktop\openCV\testExecutable\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1065:18)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:903:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\Winexcel\Desktop\openCV\testExecutable\index.js:6:12)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)

Process finished with exit code 1

I try to do it like this:
const cv = require('opencv4nodejs/build/Release/opencv4nodejs');

What's wrong is here and is it impossible to require opencv4nodejs.node?

Any solutions?