balena-io-modules / drivelist

List all connected drives in your computer, in all major operating systems
Apache License 2.0
237 stars 90 forks source link

electron: *.node is not valid win32 #301

Open BananaAcid opened 6 years ago

BananaAcid commented 6 years ago

Using electron, building on OSX, targeting windows, results in a node file that can not be used in electron.

Just importing it, electron-packager app/ --overwrite --asar --platform=win32 --arch=x64 appended by other params, it will throw '..node not win32' error, if started on windows.

kittaakos commented 5 years ago

building on OSX, targeting windows

I do not think this will work for you. It is unrelated to drivelist.

From here: If your app has native dependency, it can be compiled only on the target platform unless prebuild is not used.

msbsh commented 5 years ago

Hi @BananaAcid .. have you probably come up with a solution? E.g. forking the repository and publishing the prebuild binary for x64 or anything else? I'm currently stuck on the same issue and would like some insights.

lurch commented 5 years ago

publishing the prebuild binary

See also #331

BananaAcid commented 4 years ago

Hi @msbsh - I was using an internal intermediate repo, setting up prebuild @ it and precompiled the bin on any OS/arch relevant to me and friends.

My advice would be: either use a win-VM (Microsoft has free ISOs/VMs for devs, use with Vagrant) or cross-build and replace the required drivelist file in the output folder with some prebuild after building (since usually everything cross-builds).

Win 10 VMs Win 10 Install ISO

node-pre-gyp or prebuild targeting N-API would by a viable solution an author should implement, knowing their software does not cross-build. Some introduction about this.