node-notifier icon indicating copy to clipboard operation
node-notifier copied to clipboard

Notifications are not fired after making a windows executable using electron-builder

Open suku-h opened this issue 7 years ago • 11 comments

Node notifier is not getting fired after being packaged using electron-builder for windows. Node-Notifier needs to be unpacked as suggested. I believe I am making a mistake in the package.json while executing this process when using electron-builder.

 '"build": {
    "appId": "NotiTest",
    "asarUnpack": [
      "./app/node_modules/node-notifier/vendor/**"
    ],
    "win": {
      "icon": "./build/images/app-icon.ico",
      "target": "nsis"
    },
    "nsis": {
      "oneClick": true,
      "perMachine": false,
      "allowElevation": false
    }
  },
  "scripts": {
    "start": "NODE_ENV=development ./node_modules/.bin/electron app",
    "build": "NODE_ENV=production ./node_modules/.bin/webpack",
    "watch": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --hot --inline",
    "dist": "sh build.sh && build -w --x64 --ia32"
 }'

On creating the executable, I can see asar.unpacked file and it contains the node-notifier module which has terminal, snore-test and notifu in it. But when I run the program, the notifications are not shown.

Can you suggest what is the correct method?

suku-h avatar Jun 16 '17 14:06 suku-h

Unsure about this, if you followed the instructions in the readme it should work fine. Possible either electron or we changed something and needs further testing.

kurisubrooks avatar Jun 16 '17 14:06 kurisubrooks

Getting a similar issue on Windows 10 (Version 1607 OS Build 14393.0) with node-notifier v5.1.2 when packaged and distributed with electron-builder (^19.13.0). Electron version is ^1.6.11

The app is not in an asar.

The SnoreToast.exe is present at: ...\AppData\Local\Programs\myApp\resources\app\node_modules\node-notifier\vendor\snoreToast\SnoreToast.exe

Error: spawn 
myApp\resources\app\build\vendor\snoreToast\SnoreToast.exe ENOENT
        at exports._errnoException (util.js:1022:11)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
        at onErrorNT (internal/child_process.js:359:16)
        at _combinedTickCallback (internal/process/next_tick.js:74:11)
        at process._tickCallback (internal/process/next_tick.js:98:9)

The notifications seem to be working fine on OSX and on a Slackware 14.2 linux distro (kernel 4.4.14)

Is there any additional information I can provide to try track this down?

liquidcowgithub avatar Jul 12 '17 10:07 liquidcowgithub

Can this be a issue with long paths (there are some issues on the filesystem for windows and long paths)? You can activate debug-mode and see what command node-notifier invokes internally and you can test that out directly.

mikaelbr avatar Jan 13 '18 12:01 mikaelbr

I'm also having this issue happen for certain users. I haven't been able to figure out why it doesn't work for people.

andrewchae avatar Mar 29 '18 00:03 andrewchae

@andrewchae @suku-h did you manage to solve this?

damianobarbati avatar May 28 '18 14:05 damianobarbati

@damianobarbati I've had to stop using this package until this gets fixed.

andrewchae avatar May 28 '18 16:05 andrewchae

Notifications are working for me after bumping node-notifier from version 5.1.2 to 5.2.1.

EstesE avatar May 30 '18 14:05 EstesE

Happens to me, too. When I use electron . to run the app on Mac, notification works fine. But after I pack it into a .app file with electron-builder, notification no longer work :(

m0o0scar avatar Aug 30 '18 10:08 m0o0scar

Any update on this guys? I looked at the answer for when this happens but I am building to an nsis. On windows 10, "node-notifier": "^5.3.0",

m-o-leary avatar Nov 02 '18 14:11 m-o-leary

Any update ?

saurabhabh avatar Feb 04 '19 05:02 saurabhabh

"build": {
  "asarUnpack": [
    "./app/node_modules/node-notifier/**"
  ]
 }

not ./app/node_modules/node-notifier/vendor/**

and you must externals 'node-notifier' in your webpack config.

mlinquan avatar Mar 21 '19 07:03 mlinquan