Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Created September 10, 2019 09:24
Show Gist options
  • Save arajkumar/f8da6c9b9a86364d54be46cc37ceec11 to your computer and use it in GitHub Desktop.
Save arajkumar/f8da6c9b9a86364d54be46cc37ceec11 to your computer and use it in GitHub Desktop.
Windows exec fail on nodejs
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