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

Sharp inside Electron #1608

Closed
tomaschyly opened this issue Mar 12, 2019 · 4 comments
Closed

Sharp inside Electron #1608

tomaschyly opened this issue Mar 12, 2019 · 4 comments
Labels

Comments

@tomaschyly
Copy link

Hello, I need to have shap running inside Electron app (which runs React app, but that should not affect it).

I get this error when I try to install using yarn:

App threw an error during load
Error: The module '\\?\C:\Development\Electron\FileCtor\node_modules\sharp\build\Release\sharp.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing

So I tried to use the electron-rebuild, but then I get this error:

App threw an error during load
Error: \\?\C:\Development\Electron\FileCtor\node_modules\sharp\build\Release\sharp.node is not a valid Win32 application.
\\?\C:\Development\Electron\FileCtor\node_modules\sharp\build\Release\sharp.node
     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
     at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
     at Module.load (internal/modules/cjs/loader.js:602:32)
     at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
     at Function.Module._load (internal/modules/cjs/loader.js:533:3)
     at Module.require (internal/modules/cjs/loader.js:640:17)
     at require (internal/modules/cjs/helpers.js:20:18)
     at bindings (C:\Development\Electron\FileCtor\node_modules\bindings\bindings.js:112:48)
     at Object.<anonymous> (C:\Development\Electron\FileCtor\node_modules\sharp\lib\constructor.js:10:34)

After this I tried to uninstall node and then install the same version as Electron uses, but this did not help either. I'm fairly inexperienced when it comes to node native modules, so I'm not sure what can else I can try to do to solve this. I'm sure I was able to get different native module running previously using node-gyp.

I am using Windows 10 64bit, Electron is 4.0.8. Node is currently 10.11.0 same as Electron should be using.

@lovell
Copy link
Owner

lovell commented Mar 12, 2019

Hello, for Electron 4 pain please see #1522 - you'll probably need to use Electron 3 for now.

@tomaschyly
Copy link
Author

Thanks, I have read it and also some other issues posted elsewhere and unfortunately it seems you are right. None of the suggestions seems to work for me and I dislike going back to older Electron, but solving this issue this seems to be out your hands? Should I wait for Electron update?

I don't understand it properly, but some link here, that this should solve the issue? electron/electron#16687

@lovell
Copy link
Owner

lovell commented Mar 12, 2019

The binaries for the next sharp release will pick up changes from the various upstream dependencies and should therefore work with Electron v4.0.4+. (This problem affected all native modules, not just sharp, and was due to Electron breaking its own ABI.)

I'll update #1522 when all this happens so please subscribe to it.

@lovell lovell closed this as completed Mar 12, 2019
@xland
Copy link

xland commented Mar 14, 2019

@lovell

Electron 4.1.0 seems to have solved this issue,Is it?

Electron 4.1.0 was released to work around issues users were experiencing with node-pre-gyp based native modules and our ABI number in Electron >= 4.0.4.

https://electronjs.org/releases/stable#4.1.0

Repository owner locked and limited conversation to collaborators Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants