justadudewhohacks / justadudewhohacks/opencv4nodejs
Issue with importing cv
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 826
- PR merge metrics
- No merged PRs in 30d
Description
Hi Everyone,
I am getting the the error ERR_DLOPEN_FAILED while trying to import opencv4nodejs with typescript.
The import statement I am using is this:
import * as cv from 'opencv4nodejs';
The error trace:
2024-06-05T11:54:06.190Z ERROR @wdio/config:ConfigParser: Failed loading configuration file: file:///D:/MSTeams%20Repos/BIM/MSTeamsAppTestingWDIO/wdio.electr
on-conf.ts: The specified module could not be found.
\\?\D:\MSTeams Repos\BIM\MSTeamsAppTestingWDIO\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
Error: The specified module could not be found.
\\?\D:\MSTeams Repos\BIM\MSTeamsAppTestingWDIO\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (D:\MSTeams Repos\BIM\MSTeamsAppTestingWDIO\node_modules\opencv4nodejs\lib\cv.js:58:8)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Object.require.extensions. [as .js] (D:\MSTeams Repos\BIM\MSTeamsAppTestingWDIO\node_modules\ts-node\src\index.ts:1608:43)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (D:\MSTeams Repos\BIM\MSTeamsAppTestingWDIO\node_modules\opencv4nodejs\lib\opencv4nodejs.js:11:79)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) {
code: 'ERR_DLOPEN_FAILED'
}
I have installed opencv, set the environment variables and disabled autobuild. The package successfully installs, but I get this error.
Contributor guide
Research direction
Start by reproducing the Windows TypeScript import and inspect lib/cv.js, lib/opencv4nodejs.js, and the native build/Release path shown in the trace. Determine why the compiled addon cannot load despite installation, then verify that importing opencv4nodejs succeeds in the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, nodejs, opencv, typescript
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100