I am working on a Desktop app with electron framework which always has a terminal open the output of the processes run is shown in that terminal. I am using node-pty for this but when I try to pass a file using spawn process to be run on cmd, it just gives me the following error of file not found: enter image description here
A JavaScript error occurred in the main process
Uncaught Exception:
Error: File not found:
at new WindowsPtyAgent
node modulesnode-ptylibwindowsPtyAgent.js:80:36)
at new WindowsTerminal
node modulesnode- ptylibwindowsTerminaI js:51 :24)
at Object.spawn
node modulesnode-ptylibindexjs:29:12)
at IpcMainlmpl.<anonymous> (main.js88:25)
at IpcMainlmpl.emit (node:events:519:28
at WebContents.<anonymous> (node:electron/js2c/browser_init:2:82388)
at WebContents.emit (node:events:519:28)
the file is there and it works without pty.
Initially, I was expecting for the output of cmd to be shown in my shell process which is being run through pty. I have a pty process which is used all the time for a terminal I tried removing that terminal changing the order of them being called but the only thing that worked was to remove pty and just use a spawn process which gave me the correct result I was expecting in the beginning. I want all the results to be shown in the same terminal only and not another div.
shivay sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.