Skip to content

Commit

Permalink
Docs: make use of optional dependencies even clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Dec 2, 2023
1 parent c80e92f commit 4d049ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/sharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 4d049ee

Please sign in to comment.