Created
September 10, 2019 09:24
-
-
Save arajkumar/f8da6c9b9a86364d54be46cc37ceec11 to your computer and use it in GitHub Desktop.
Windows exec fail on nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cp = require('child_process'); | |
const testCmd = `python -c 'exec("""\nprint(2)""")'`; | |
cp.exec( | |
testCmd, | |
{ maxBuffer: 1024 * 1200 }, | |
(error, _stdout, _stderr) => { | |
if (error) { | |
console.log(_stderr); | |
console.log(error.message); | |
} else { | |
console.log(_stdout); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment