You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I want to use child_process to invoke an exe file in a React + Electron Project. But some error happend when I import child_process module.
The first is Module not found: Error: Can't resolve 'child_process'
I solve it by add "browser": { "child_process": false } to package.json ,It package successfully.
But when I click a button which use child_process invoke an external exe. It will throw a second error spawn() is not a function.
I have tried
change import { spawn } from 'child_process' to const { spawn } = require('child_process')
I just add a button to test child_process spawn() invoke an exe.
Please help me, thanks~
The text was updated successfully, but these errors were encountered:
Hello, I want to use child_process to invoke an exe file in a React + Electron Project. But some error happend when I import child_process module.
The first is
Module not found: Error: Can't resolve 'child_process'
I solve it by add
"browser": { "child_process": false }
topackage.json
,It package successfully.But when I click a button which use child_process invoke an external exe. It will throw a second error
spawn() is not a function
.I have tried
import { spawn } from 'child_process'
toconst { spawn } = require('child_process')
I just add a button to test child_process spawn() invoke an exe.
Please help me, thanks~
The text was updated successfully, but these errors were encountered: