Skip to content

Instantly share code, notes, and snippets.

@jcesarmobile
Created April 20, 2022 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcesarmobile/63c1bec9201b9ae1ba92bec646cadd52 to your computer and use it in GitHub Desktop.
Save jcesarmobile/63c1bec9201b9ae1ba92bec646cadd52 to your computer and use it in GitHub Desktop.
Spawn closing with -2 on nodejs installed from homebrew
const { spawn } = require('child_process');
const child = spawn('./gradlew', [], { cwd: './android' });
child.stdout.on('data', data => {
console.log(`stdout:\n${data}`);
});
child.stderr.on('data', data => {
console.error(`stderr: ${data}`);
});
child.on('close', (code) => {
console.log(`Child process closed with code ${code}`);
});
child.on('error', (error) => {
console.error(`error: ${error.message}`);
});
child.on('exit', function (code) {
console.log(`Child process exited with code ${code}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment