The following will never exit
var child_process = require(\'child_process\');
var ps = child_process.spawn(\'.\\\\node_modules\\\\.bin\\\\babel.cmd\', [\'in
The most straight forward solution, don't spawn scripts instead spawn node directly.
For unix, the script is the npm executable. For windows however we need to resolve the name from the .cmd file.
if (path.extname(command).toLowerCase() == '.cmd') {
var content = '' + fs.readFileSync(command);
var link = (/node "%~dp0\\(.*?)"/.exec(content) || [])[1];
if (link) {
command = path.resolve(path.dirname(command), link);
}
}
var ps = child.spawn('node', [command].concat(args), options);