diff --git a/src/class/Util.ts b/src/class/Util.ts index ea7e228..25819f2 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -46,9 +46,9 @@ export default class Util { cmd.stderr.on('data', writeFunction); cmd.on('error', writeFunction); cmd.once('close', (code, signal) => { - cmd.stdout.removeListener('data', writeFunction); - cmd.stderr.removeListener('data', writeFunction); - cmd.removeListener('error', writeFunction); + cmd.stdout.off('data', writeFunction); + cmd.stderr.off('data', writeFunction); + cmd.off('error', writeFunction); if (error) rej(new Error(output)); res(output); });