coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.83k stars 356 forks source link

Using node-windows in electron app #232

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hi,

I have an issue using node-windows in my electron app. I already check this post but it did not help me https://github.com/coreybutler/node-windows/issues/173

My project is almost the same : The Electron app will just allow me to "manage" the service via a Tray Menu and especially to install it with a multi-platform setup (.exe, .msi, linux, ...).

My problem : the whole app works in dev (Tray menu, install service, start/stop service and others features via the menu). Electron can build it (.exe). It installs the app but when it starts an error message is displayed : "Cannot find module 'node-windows'" (see screenshot for more details)

I have two package.json and both contain "node-windows": "^0.1.14" in dependencies -root/ --app/ ---package.json --package.json ("main": "app/electron.js")

Can you help me please ? You can find my electron.js file and how it use the service in service.js (attached as .txt files)

node-windows ) electron.txt service.txt

coreybutler commented 4 years ago

Closing due to age.

For anyone coming across this via a Google search:

This most likely has to do with the build process not properly including node-windows. Issue #245 dives into some detail about working with Electron and node-windows