electron-builder: Native Dependencies missing in electron-builder 24

I am building for Windows on a Linux machine. With electron-builder 23 that works fine and I can see that the native dependencies (keytar in my case) are handled.

> electron-builder install-app-deps

  • electron-builder  version=23.6.0
  • loaded configuration  file=package.json ("build" field)
  • loaded parent configuration  preset=react-cra
  • rebuilding native dependencies  dependencies=keytar@7.9.0, register-scheme@0.0.2 platform=win32 arch=x64
  • install prebuilt binary  name=keytar version=7.9.0 platform=win32 arch=x64 napi=

But when I update to version 24, the application built on Linux does not run on Windows anymore and throws a “not a win32 application” error. When built on Windows it works. From the output I noticed that there is no mention anymore of the native dependencies.

> electron-builder install-app-deps

  • electron-builder  version=24.4.0
  • loaded configuration  file=package.json ("build" field)
  • loaded parent configuration  preset=react-cra
  • executing @electron/rebuild  arch=x64 version=25.1.1 appDir=/opt/work/93594e21797f15d9/app

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

finally found something that works. could not get prebuildify to work, but something based on prebuild / prebuild-install appears to be working now 😃 hopefully i can now ditch the vms with windows. The forked library is at https://github.com/universal/win-audio if you are looking for some inspiration… haven’t added any ci-pipelines here.

so this works for me with 24.6.3 😃

What should work if precompiled binaries are uploaded to github. The package I use does not have those.

If the package does not have those, then you need to compile the dependencies from the source code, meaning you need a Mac and a Windows build node at minimum. (Mac build node can compile Linux .node modules) Cross-compiling native dependencies is not possible.