justadudewhohacks / justadudewhohacks/opencv4nodejs

opencv4nodejs to .exe executable file

Open
#777 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

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. (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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.