MikeKovarik / rollup-plugin-notify

📟 Displays rollup errors as system notifications.
MIT License
19 stars 5 forks source link

Wrong path to SnoreToast #9

Open egml opened 3 years ago

egml commented 3 years ago

I'm very new to Node.js so please excuse me if I missed something obvious. Also it could be just my setup since no one filed an issue about it yet.

So notifications was not working for me. And I found out that it was because the path to executable SnoreToast.exe was wrong. The possible problem is here:

index.js

...
var snorePath = './node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe'
snorePath = path.join(__dirname, snorePath)
...

If you change it to something like this, notifications will start to work:

index.js

...
var snorePath = './node_modules/node-notifier/vendor/snoreToast/SnoreToast.exe'
snorePath = path.join(path.resolve(__dirname, '../..'), snorePath)
...

I don't know, if this is a good solution, or even solution at all. Maybe all of this happened because of newer Node and NPM versions, or maybe because I'm using Yarn. Some explanation would be appreciated and also an advice should I make a PR on this or something. I would love to do that) Thanks!

Node.js - v12.19.0 NPM - v6.14.8

egml commented 3 years ago

And also what i was able to discover is that sometimes you need to add argument -w to SnoreToast executable for the whole thing to work. You can do it by adding args.push('-w'). There is definitely something wrong with ether node-notify module, or with SnoreToast itself.