node-process-windows icon indicating copy to clipboard operation
node-process-windows copied to clipboard

Cannot read properties of null (reading 'filter')

Open pilz97 opened this issue 3 years ago • 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?

pilz97 avatar Feb 16 '22 15:02 pilz97

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") + '"';

UEhQZXI avatar Feb 27 '22 13:02 UEhQZXI