From 9ee377963ef10af234360b01412678440346256f Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 17 Mar 2019 23:07:58 +0000 Subject: [PATCH] Improve error message if libvips tarball is corrupt --- install/libvips.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install/libvips.js b/install/libvips.js index 673267b3..da2e4ab2 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -34,7 +34,12 @@ const extractTarball = function (tarPath) { cwd: vendorPath, strict: true }) - .catch(fail); + .catch(function (err) { + if (/unexpected end of file/.test(err.message)) { + npmLog.error('sharp', `Please delete ${tarPath} as it is not a valid tarball`); + } + fail(err); + }); }; try {