From 4d049ee8f54f12faf452492217db981ed26d086e Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 2 Dec 2023 09:20:42 +0000 Subject: [PATCH] Docs: make use of optional dependencies even clearer --- docs/install.md | 2 +- lib/sharp.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index a4dc064e4..3747f1832 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,7 +2,7 @@ Works with your choice of JavaScript package manager. -Please ensure optional dependencies can be installed. +> ⚠️ **Please ensure your package manager is configured to install optional dependencies** ```sh npm install sharp diff --git a/lib/sharp.js b/lib/sharp.js index af18adec3..74496c522 100644 --- a/lib/sharp.js +++ b/lib/sharp.js @@ -46,6 +46,8 @@ if (sharp) { // Common error messages if (prebuiltPlatforms.includes(runtimePlatform)) { const [os, cpu] = runtimePlatform.split('-'); + help.push('- Ensure optional dependencies can be installed:'); + help.push(' npm install --include=optional'); help.push('- Add platform-specific dependencies:'); help.push(` npm install --os=${os} --cpu=${cpu} sharp`); help.push(' or');