Skip to content

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

Open
@dpalou

Description

@dpalou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions