bryphe/node-process-windows

Cannot read properties of null (reading 'filter')

Opened this issue · 1 comments

Hello,

i am using node-process-windows inside my electron app.
But i get an error:
TypeError: Cannot read properties of null (reading 'filter') at C:\Executeables\testapp\resources\app.asar\node_modules\node-process-windows\index.js:78:39 at C:\Executeables\testapp\resources\app.asar\node_modules\node-process-windows\index.js:100:13 at ChildProcess.exithandler (node:child_process:413:5) at ChildProcess.emit (node:events:394:28) at maybeClose (node:internal/child_process:1067:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

I also tried to make a small node application, in this application I hade no problem with the package but in my electron app it won't work does anyone have an idea?

Because the executed command contains spaces, exec() will truncate the command at the spaces.
Change the fourth line in the file "node_modules/node-process-windows/index.js" to
var windowsFocusManagementBinary = '"' + path.join(__dirname, "windows-console-app", "windows-console-app", "bin", "Release", "windows-console-app.exe") + '"';