I'm trying to run "npm publish" from a gulp task. It works, but I want to handle any error that npm command itself throws.
If I execute this code:
var cmd = spawnSync('npm.cmd', ['publish', packageDir], { stdio: 'inherit' })
cmd.stdout and cmd.stderr are null. If I execute
var cmd = spawnSync('npm.cmd', ['publish', packageDir], { stdio: 'pipe' })
cmd.stdout and cmd.stderr are buffers, like <Buffer 6e 70 6d 20 45 52...
What am I missing here?
cmd.stderr.toString()
, I can see the error, but cmd,error is still undefined... – Thapsus