argv-minus-one / dmg-license

Generate license agreements for macOS .dmg files
MIT License
19 stars 6 forks source link

error: The platform "win32" is incompatible with this module #14

Closed MassMessage closed 2 years ago

MassMessage commented 2 years ago

I'm getting tons of odd erros that i'm trying to fix (full list here) but among them:

Module not found: Error: Can't resolve 'dmg-license' in 'C:\Users\jack\Desktop\merge\Newton\node_modules\dmg-builder\out'

so I went to install by yarn add dmg-license but I get the error:

error iconv-corefoundation@1.1.7: The platform "win32" is incompatible with this module.

Out the missing modules, this is the only one that I couldn't install. Note that i'm trying to build on windows not on mac, I'm not using this module directly. I'm just trying to install the missing modules so I can build it

argv-minus-one commented 2 years ago

You're getting that error because both dmg-license and iconv-corefoundation (which dmg-license depends on) don't work at all on anything other than macOS.

From your error log, it looks like electron-builder is configured to generate a dmg file and attach a license agreement to it. That can only be done on a Mac, because attaching a license agreement to a dmg (at least with this dmg-license package) involves calling macOS APIs (namely CoreFoundation.framework and the hdiutil command-line program) that don't exist on any other platform.

If you want to build a dmg on Windows, you'll have to not attach a license agreement to it and show your license agreement another way. You should probably do that anyway, as dmg license agreements are deprecated by Apple and will probably be removed soon; see issue #11 for details.

MassMessage commented 2 years ago

You're getting that error because both dmg-license and iconv-corefoundation (which dmg-license depends on) don't work at all on anything other than macOS.

From your error log, it looks like electron-builder is configured to generate a dmg file and attach a license agreement to it. That can only be done on a Mac, because attaching a license agreement to a dmg (at least with this dmg-license package) involves calling macOS APIs (namely CoreFoundation.framework and the hdiutil command-line program) that don't exist on any other platform.

If you want to build a dmg on Windows, you'll have to not attach a license agreement to it and show your license agreement another way. You should probably do that anyway, as dmg license agreements are deprecated by Apple and will probably be removed soon; see issue #11 for details.

I didn't mean directly to generate such license for mac on windows. I was just figuring out how to use electron-builder, electron-forget, etc so that I could use webpack wihin my application. How do I prevent to try to generate such dmg-license on windows? I don't need this nowat all. The application was working tootally fine when suddently the yarn make stoped working and I got ton of those errors.

argv-minus-one commented 2 years ago

I'm sorry, but I can't help you there. I'm not familiar with electron-builder configuration.

MassMessage commented 2 years ago

I see, thanks anyway for your help.