Native binaries not included when building with electron-builder


#1

I have an electron app that uses two dependencies that have native binaries, node-keytar and desktop-idle.

During development I simply run node_modules/.bin/electron-rebuild to build these binaries for electron. I can then run my app with electron ./myapp and it works just fine.

I am now trying to build my app for distribution with electron-builder --dir. I then run the unpacked .exe on my Windows development machine and get errors about:

Error: Cannot find module 'desktop-idle`.

I get the same problem when using electron-builder on my Macbook.


How do I properly include native dependency libraries with electron-builder?

I see there is a nodeGypRebuild configuration setting, but it explicitly says that this is only if I have native addons I have built myself, not for dependencies. I tried it anyways and it then starts complaining about a missing binding.gyp file.

For reference, you find find my project’s source at https://github.com/bitwarden/desktop


#2

I’m debugging the same issue. No answers yet, just thought I’d make some noise for this.