justadudewhohacks / justadudewhohacks/opencv4nodejs

cannot run the installation build, but dev version is working

Open
#707 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

# Error Message
It seems that my case is unique and novel after trying various existing claim-to-work methods.

This issue was concerned
- `electron`
- `electron-builder` instead of `electron-rebuild`
- `windows` just install with a proper set up of node

```
electron/js2c/asar.js:138 Uncaught (in promise) Error: The specified module could not be found.
\\?\C:\Users\User\AppData\Local\Temp\b3ccaeda-cfb0-43e5-868c-cab1254fdf7d.tmp.node
at process.func (electron/js2c/asar.js:138)
at process.func [as dlopen] (electron/js2c/asar.js:138)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:828)
at Object.func (electron/js2c/asar.js:138)
at Object.func [as .node] (electron/js2c/asar.js:147)
at Module.load (internal/modules/cjs/loader.js:645)
at Function.Module._load (internal/modules/cjs/loader.js:560)
at Module.require (internal/modules/cjs/loader.js:685)
at require (internal/modules/cjs/helpers.js:16)
at Object. (C:\Users\User\AppData\Local\Programs\Labmate\resources\app.asar\node_modules\opencv4nodejs\lib\cv.js:58)
at Object. (C:\Users\User\AppData\Local\Programs\Labmate\resources\app.asar\node_modules\opencv4nodejs\lib\cv.js:69)
at Module._compile (internal/modules/cjs/loader.js:786)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798)
at Module.load (internal/modules/cjs/loader.js:645)
at Function.Module._load (internal/modules/cjs/loader.js:560)
at Module.require (internal/modules/cjs/loader.js:685)
```

This will be shown if you run the program from the installer build by `electron-builder`.

But, it won't show if you run using `electron .`

To correct build an electron project I followed this order
1. build the native dependencies via `electron-builder --win`
2. run `electron .`

# Workaround I tried [but Not working]

I changed to manual build, but found out that **it was not better than using autobuild**.

## Tried https://github.com/justadudewhohacks/opencv4nodejs/issues/440
Since it seems resambled the error I faced, however it was filed in 2018. At that time autobuild might not be this well-established.

Outcome is leading to another workaround.
## Tried https://medium.com/@makearts/how-to-use-opencv4-on-electron-113b11623b7a

## Tried `"asar": false` https://github.com/justadudewhohacks/opencv4nodejs/issues/204

I won't elaborate on the manual build since it is not focus of this issue.

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.