justadudewhohacks / opencv4nodejs

Nodejs bindings to OpenCV 3 and OpenCV 4
MIT License
4.95k stars 825 forks source link

Error 126 #745

Open ghmendonca opened 4 years ago

ghmendonca commented 4 years ago

Error Message

App threw an error during load Error: error: 126

Error Details

I managed to install opencv4nodejs on my electron project and the electron-rebuild worked just fine. But now when I try to run my application I got the following error:

Error: error: 126

And the stack trace:

Error: error: 126\\?\C:\Users\User\Documents\project\electron\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1016:18)
    at Object.func [as .node] (electron/js2c/asar.js:140:31)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Function.Module._load (electron/js2c/asar.js:748:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\User\Documents\project\electron\node_modules\opencv4nodejs\lib\cv.js:58:8)
    at Module._compile (internal/modules/cjs/loader.js:968:30)

I couldn't find anything related to this issue, so that's why I'm opening this one, and also I took a look at the source code of this project and couldn't find anything that helps me.. Anyone has any ideas why is this happening?

MCMathi commented 10 months ago

Hey there, I'm having the same issue here... any help would be appreciated (thats just my third day on those issues)! I got it working yesterday, but today (just after having started my windows pc) I get supprised by that error message...

Here is my stack:

[nodemon] starting `node` .
node:internal/modules/cjs/loader:1473
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: error: 126\\?\C:\opencv_nodejstest\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\opencv_nodejstest\node_modules\opencv4nodejs\lib\cv.js:58:8)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v20.10.0

I already tried to delete the node_modules folder and installed again by first npm install opencv-build and, after no issues here, continuing by npm install opencv4nodejs. Just reify taking some time but other than that everything installs just fine. But running my code (that was still working yesterday without any issues) left me with that stack trace.

amalsakkoumi commented 4 months ago

did you find the solution for that problem ? I'm having the same . any help please