mikaelbr / node-notifier

A Node.js module for sending notifications on native Mac, Windows and Linux (or Growl as fallback)
MIT License
5.73k stars 322 forks source link

Does not seem to work anymore on Electron 11.x #352

Open jcompagner opened 3 years ago

jcompagner commented 3 years ago

i get:

error in the main process

resources\app.asar\node_modules\node-notifier\package.json: Unexpected end of JSON Input

and reading up this: https://github.com/electron/electron/issues/18397

it seems that native packages must be Context Aware modules or NAPI ?

laurent22 commented 3 years ago

For me it's broken as well as of Electron 10, but was working in Electron 8.

laurent22 commented 3 years ago

In fact, at least in some cases you don't need node-notifier on Electron as you can simply use the native browser notifications. If anyone's interested, this is how I've implemented it in my app: https://github.com/laurent22/joplin/commit/849ef418a66689f394be4b6a57413bee8e39ce9d#diff-686a0aacaa9f295468381cf9605f6add22f8b777953753329a60ead828a4f289R67