Docs: improve cross-platform help messaging

tldr; don't use npm for multi-platform installs
This commit is contained in:
Lovell Fuller
2023-12-13 12:59:14 +00:00
parent c5eaeb2ddb
commit 3a0c375692
3 changed files with 20 additions and 10 deletions

View File

@@ -49,11 +49,11 @@ if (sharp) {
help.push(
'- Ensure optional dependencies can be installed:',
' npm install --include=optional sharp',
' or',
' yarn add sharp --ignore-engines',
'- Ensure your package manager supports multi-platform installation:',
' See https://sharp.pixelplumbing.com/install#cross-platform',
'- Add platform-specific dependencies:',
` npm install --os=${os} --cpu=${cpu} sharp`,
' or',
` npm install --force @img/sharp-${runtimePlatform}`
);
} else {
@@ -61,7 +61,6 @@ if (sharp) {
`- Manually install libvips >= ${minimumLibvipsVersion}`,
'- Add experimental WebAssembly-based dependencies:',
' npm install --cpu=wasm32 sharp',
' or',
' npm install --force @img/sharp-wasm32'
);
}
@@ -103,7 +102,7 @@ if (sharp) {
}
help.push(
'- Consult the installation documentation:',
' https://sharp.pixelplumbing.com/install'
' See https://sharp.pixelplumbing.com/install'
);
throw new Error(help.join('\n'));
}