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

node-notifier don't work on macOS 12.2.1 #403

Closed F3n67u closed 2 years ago

F3n67u commented 2 years ago

Reproduce step

$ cat package.json 
{
  "dependencies": {
    "node-notifier": "^10.0.1"
  }
}

$ cat test.js     
const notifier = require('node-notifier');

notifier.notify({
  title: 'My notification',
  message: 'Hello, there!'
});

# no notification after run test.js, just silently fail
$ DEBUG=notifier node test.js
node-notifier debug info (fileCommandJson):
[notifier path] /Users/feng/test/test-notify/node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier
[notifier options] -title "My notification" -message "Hello, there!" -timeout "10" -json "true"

Expect Behavior

should send a notification

Actual Behavior

no notification shows

Environment

macOS version: 12.2.1 node: v17.6.0

F3n67u commented 2 years ago

I forgot to turn on notification permission to terminal-notifier, so node-notifier won't work. after turning on the permission, notification shows.

image
Amethystafyy282 commented 2 years ago

But how did you manage to ask for permission during production?