When 'tray_darwin_release' process is killed, it sends a 'Quit' command to node-systray. However, node-systray expects this to be JSON. Hence JSON.parse() throws an error causing 'node' process to be killed.
undefined:1
Quit
^
SyntaxError: Unexpected token Q in JSON at position 0
at JSON.parse (<anonymous>)
at Interface.<anonymous> (/Users/user/myapp/node_modules/systray/lib/index.js:76:31)
at emitOne (events.js:121:20)
at Interface.emit (events.js:211:7)
at Interface._onLine (readline.js:282:10)
at Interface._normalWrite (readline.js:424:12)
at Socket.ondata (readline.js:141:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)