From ab7840b335d58f59731315354f2ea18d6bdf8fd6 Mon Sep 17 00:00:00 2001 From: Michael Mifsud Date: Tue, 8 Nov 2022 22:08:33 +1100 Subject: [PATCH] Fix binaries being partially downloaded (#3313) --- scripts/install.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install.js b/scripts/install.js index e474506ff..42511b393 100644 --- a/scripts/install.js +++ b/scripts/install.js @@ -37,7 +37,9 @@ function download(url, dest, cb) { try { fetch(url, downloadOptions()).then(function (response) { - fs.createWriteStream(dest).on('error', cb).end(response.data, cb); + return response.buffer(); + }).then(function (buffer) { + fs.createWriteStream(dest).on('error', cb).end(buffer, cb); console.log('Download complete'); }).catch(function(err) { if(!successful(err)) {