electron-windows-notifications icon indicating copy to clipboard operation
electron-windows-notifications copied to clipboard

Plugin not working in Angular apps: You tried to use electron-windows-notifications, but you're not running Windows 10, 8.1, or 8

Open dpalou opened this issue 6 years ago • 0 comments

Hi,

we tried to use this plugin in an Angular app packaged using Electron. When trying to use notifications, I received this warning:

You tried to use electron-windows-notifications, but you're not running Windows 10, 8.1, or 8. No operations will be performed.

This is because Angular also declares a global variable "process". In this line, the process variable is the Angular one, not the Node one, so process.platform is undefined and it thinks the environment isn't Windows.

I was able to fix this by adding this line to the start of index.js:

const process = require('process')

I'm not sure if this is the best approach to fix the issue, so I prefer opening an issue instead of sending a PR.

dpalou avatar Jul 17 '18 10:07 dpalou