@@ -74,20 +74,28 @@ The target platform and/or architecture can be manually selected using the follo
7474npm install --platform=... --arch=... --arm-version=... sharp
7575```
7676
77- * ` --platform ` : one of ` linux ` , ` linuxmusl ` , ` darwin ` or ` win32 ` .
77+ * ` --platform ` : one of ` linux ` , ` darwin ` or ` win32 ` .
7878* ` --arch ` : one of ` x64 ` , ` ia32 ` , ` arm ` or ` arm64 ` .
7979* ` --arm-version ` : one of ` 6 ` , ` 7 ` or ` 8 ` (` arm ` defaults to ` 6 ` , ` arm64 ` defaults to ` 8 ` ).
80+ * ` --libc ` : one of ` glibc ` or ` musl ` . This option only works with platform ` linux ` , defaults to ` glibc `
8081* ` --sharp-install-force ` : skip version compatibility and Subresource Integrity checks.
8182
8283These values can also be set via environment variables,
83- ` npm_config_platform ` , ` npm_config_arch ` , ` npm_config_arm_version `
84+ ` npm_config_platform ` , ` npm_config_arch ` , ` npm_config_arm_version ` , ` npm_config_libc `
8485and ` SHARP_INSTALL_FORCE ` respectively.
8586
8687For example, if the target machine has a 64-bit ARM CPU and is running Alpine Linux,
8788use the following flags:
8889
8990``` sh
90- npm install --arch=arm64 --platform=linuxmusl sharp
91+ npm install --arch=arm64 --platform=linux --libc=musl sharp
92+ ```
93+
94+ If the current machine is Alpine Linux and the target machine is Debian Linux on x64 cpu,
95+ use the following flags:
96+
97+ ``` sh
98+ npm install --arch=x64 --platform=linux --libc=glibc sharp
9199```
92100
93101## Custom libvips
@@ -215,7 +223,8 @@ run the following additional command after `npm install`:
215223
216224``` sh
217225npm install
218- SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux sharp
226+ rm -rf node_modules/sharp
227+ SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux --libc=glibc sharp
219228```
220229
221230To get the best performance select the largest memory available.
0 commit comments