From 1823b58fae092e96dd8a88c29220d2e5a984494e Mon Sep 17 00:00:00 2001 From: xzyfer Date: Tue, 8 Nov 2022 21:37:55 +1100 Subject: [PATCH] Fix binaries being partially downloaded Regressed in #3193 Fixes #3300 --- 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)) {