Can't import child_process #18142
Unanswered
taxuexunshang
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You can't use |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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')
The project sorece code in electron-react-boilerplate, I just add a button to test child_process spawn() invoke an exe.
Please help me, thanks~
Beta Was this translation helpful? Give feedback.
All reactions