From ba843002be2b8318921776804d83411dc2d1ee5e Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Wed, 24 Apr 2024 08:30:50 +0100 Subject: [PATCH] Docs: use libc flag for npm Linux cross-installs --- docs/install.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/install.md b/docs/install.md index 65a1a2fe7..317895d32 100644 --- a/docs/install.md +++ b/docs/install.md @@ -67,15 +67,17 @@ within the same installation tree and/or using the same lockfile. Provides limited support via `--os`, `--cpu` and `--libc` flags. -Example to support both Intel and ARM CPUs on macOS: +To support macOS with Intel x64 and ARM64 CPUs: ```sh npm install --cpu=x64 --os=darwin sharp npm install --cpu=arm64 --os=darwin sharp ``` -Example to support both glibc and musl-based Linux: +When the cross-target is Linux, the C standard library must be specified. + +To support glibc (e.g. Debian) and musl (e.g. Alpine) Linux with Intel x64 CPUs: ```sh -npm install --cpu=x64 --os=linux sharp +npm install --cpu=x64 --os=linux --libc=glibc sharp npm install --cpu=x64 --os=linux --libc=musl sharp ```