diff --git a/build/post-install.js b/build/post-install.js index dd2a74966..834b9d8bb 100644 --- a/build/post-install.js +++ b/build/post-install.js @@ -63,13 +63,15 @@ 'Accept': 'application/vnd.github.v3.raw' } }, function(response) { + var decompressor = zlib.createUnzip().on('error', callback); + var parser = new tar.Extract({ 'path': options.path }) .on('end', callback) .on('error', callback); - response.pipe(zlib.createUnzip()).pipe(parser); + response.pipe(decompressor).pipe(parser); }) .on('error', callback); }