From 853a20358e1b17d7b74effe1ad350f5311fd41b3 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 21 Jun 2022 08:22:05 +0100 Subject: [PATCH] Install: add help for possible worker thread problem #3268 --- lib/sharp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sharp.js b/lib/sharp.js index 7a7078d9a..e90109137 100644 --- a/lib/sharp.js +++ b/lib/sharp.js @@ -12,6 +12,9 @@ try { help.push('- Update Homebrew: "brew update && brew upgrade vips"'); } else { const [platform, arch] = platformAndArch.split('-'); + if (platform === 'linux' && /Module did not self-register/.test(err.message)) { + help.push('- Using worker threads? See https://sharp.pixelplumbing.com/install#worker-threads'); + } help.push( '- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"', `- Install for the current ${platformAndArch} runtime: "npm install --platform=${platform} --arch=${arch} sharp"`