Created
April 20, 2022 11:44
-
-
Save jcesarmobile/63c1bec9201b9ae1ba92bec646cadd52 to your computer and use it in GitHub Desktop.
Spawn closing with -2 on nodejs installed from homebrew
This file contains 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 { 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