mikaelbr / node-notifier

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

Not compatible with cluster worker processes on Windows. #410

Open zamb3zi opened 2 years ago

zamb3zi commented 2 years ago

The following example generates "TypeError: handle.setSimultaneousAccepts is not a function" on Windows:

const cluster = require('cluster');
const notifier = require('node-notifier');

if(cluster.isPrimary) {
    cluster.fork();
    notifier.notify('OK'); // this works
} else {
    notifier.notify('Error'); // this generates handle.setSimultaneousAccepts is not a function
}

Tested with Windows 10, Node 16.16.0/16.13.2/16.13.1 and node-notifier 10.0.1 and 8.0.2.

Thanks!