Faced with the need to run an external process from a nodovskogo script. Let's say the external process is started by the command
yarn install In the child_process node module, child_process is a non-blocking exec method, with the help of a callback of which I can see errors
exec('yarn install', function (error, stdout, stderr) { if (error) console.log(error.code) }) However, I need the operation to be performed synchronously, for which I use execSync ,
execSync('yarn install') which no longer output any messages to the console.
How to get the output stream?