diff --git a/lib/sharp.js b/lib/sharp.js index f0eb565ef..6101fd645 100644 --- a/lib/sharp.js +++ b/lib/sharp.js @@ -46,6 +46,7 @@ if (sharp) { // Common error messages if (prebuiltPlatforms.includes(runtimePlatform)) { const [os, cpu] = runtimePlatform.split('-'); + const libc = os.endsWith('musl') ? ' --libc=musl' : ''; help.push( '- Ensure optional dependencies can be installed:', ' npm install --include=optional sharp', @@ -53,15 +54,14 @@ if (sharp) { '- 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`, - ` npm install --force @img/sharp-${runtimePlatform}` + ` npm install --os=${os.replace('musl', '')}${libc} --cpu=${cpu} sharp` ); } else { help.push( `- Manually install libvips >= ${minimumLibvipsVersion}`, '- Add experimental WebAssembly-based dependencies:', ' npm install --cpu=wasm32 sharp', - ' npm install --force @img/sharp-wasm32' + ' npm install @img/sharp-wasm32' ); } if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {