Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node-pre-gyp #437

Merged
merged 1 commit into from Sep 5, 2016
Merged

Update node-pre-gyp #437

merged 1 commit into from Sep 5, 2016

Conversation

danschultzer
Copy link
Collaborator

@danschultzer danschultzer commented Sep 2, 2016

The older node-pre-gyp 0.6.11 version prevented proper handling of electron runtime (as discussed in mapbox/node-pre-gyp#175). bindings.js can't resolve the proper build path for electron. Updating to 0.6.30 fixes the issue.

Resolves #430

The older `node-pre-gyp` version prevented proper handling with electron (as shown in mapbox/node-pre-gyp#175).
@csanz
Copy link

csanz commented May 11, 2017

I still get Error: Cannot find module 'opencv'

I chanted the local reference to use global reference instead and still fubar.

If I use the local version I get a different error... Error: Cannot find module '/Users/csanz/Apps/node-opencv/build/opencv/v6.0.0/Release/node-v48-darwin-x64/opencv.node'

@lapereirabr
Copy link

Me too, with node-pre-gyp 0.6.34 version.

Error: Não foi possível encontrar o módulo especificado.
\?\c:\PROJETOS_WEB\PROJETOS\src\Prototipo.rpi\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64\opencv.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (c:\PROJETOS_WEB\PROJETOS\src\Prototipo.rpi\node_modules\opencv\lib\bindings.js:4:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

@fakob
Copy link
Contributor

fakob commented Jul 13, 2017

I get the same error: Cannot find module '...node_modules/opencv/build/opencv/v6.0.0/Release/node-v54-darwin-x64/opencv.node'

My node-pre-gyp version is 0.6.36

Any idea how to make opencv work with electron?

@danschultzer
Copy link
Collaborator Author

@fakob we've OpenCV running with electron in this project: https://github.com/danschultzer/blazing-bookkeeper

@fakob
Copy link
Contributor

fakob commented Jul 13, 2017

@danschultzer thanks for the fast response. I will check it out.

@danschultzer
Copy link
Collaborator Author

@fakob no problem! You might also find this blog post useful: https://dreamconception.com/tech/electron-how-to-build-package-and-package-3rd-party-binaries-with-electron-builder/

It explains how to build and code sign third party libraries with electron. I also added some comments on OpenCV caveats.

@nicholasc
Copy link

nicholasc commented Aug 4, 2017

I get the same thing using electron-builder install-app-deps. It's looking for node-v53-darwin-x64 when I launch the app using election app but electron-builder compiled electron-v1.6-darwin-x64

@csanz @lapereirabr @fakob any luck figuring out why it's still looking for the wrong module?

@fakob
Copy link
Contributor

fakob commented Aug 4, 2017

Hi @nicholasc

Sorry, I have too little insight why this is happening, but if I remember correctly this solved it for me:

export npm_config_target=1.6.10
export npm_config_arch=x64
export npm_config_target_arch=x64
export npm_config_disturl=https://atom.io/download/electron
export npm_config_runtime=electron
export npm_config_build_from_source=true
HOME=~/.electron-gyp npm install

Well, it worked for me at least with my setup. See
electron-react-boilerplate/electron-react-boilerplate#1148

@danschultzer
Copy link
Collaborator Author

danschultzer commented Aug 4, 2017

@nicholasc I can't remember what I did to resolve it, but I remember seeing the same error. The reason for the happening is that the node V8 engine is different from electron's.

In my project I was using electron-boilerplate to do most of the setup, and I think the solution for me was just to run the commands in the right order. There's a readme section on how native modules should be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

installed, cannot find module [opencv] in electron platform(#426)
6 participants