electron / packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI
https://npm.im/@electron/packager
BSD 2-Clause "Simplified" License
175 stars 17 forks source link

Cannot force install platform specific NPM dependency #615

Closed binaryminutia0l closed 7 years ago

binaryminutia0l commented 7 years ago

I'm making a cross-platform Electron app. When run on Windows, I need to inspect the registry, so I'm using regedit.

I'm doing my development on macOS, so in order to install and use the dependency for development, I had to run npm i -f regedit --save, in order to force it to install on the unintended platform.

However, when I then come to package my app, I get:

Error installing a Node dependency into the Electron Build Directory:

Error: Unsupported platform for regedit@2.2.6

I can't see anything in the API docs, which would allow me to force install any NPM dependencies during packaging. Is there a workaround for this? I assume I could do the packaging on Windows itself, but given that it is possible to force install with NPM's -f flag, I'd rather not have to do that.

malept commented 7 years ago

Does this error occur during the prune step?

binaryminutia0l commented 7 years ago

Sorry, I'm using ember-electron and just realised they're using custom commands for packaging, I thought they were using electron-packager underneath. I will close this issue and raise it against ember-electron.