@@ -74,20 +74,28 @@ The target platform and/or architecture can be manually selected using the follo
74
74
npm install --platform=... --arch=... --arm-version=... sharp
75
75
```
76
76
77
- * ` --platform ` : one of ` linux ` , ` linuxmusl ` , ` darwin ` or ` win32 ` .
77
+ * ` --platform ` : one of ` linux ` , ` darwin ` or ` win32 ` .
78
78
* ` --arch ` : one of ` x64 ` , ` ia32 ` , ` arm ` or ` arm64 ` .
79
79
* ` --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 `
80
81
* ` --sharp-install-force ` : skip version compatibility and Subresource Integrity checks.
81
82
82
83
These 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 `
84
85
and ` SHARP_INSTALL_FORCE ` respectively.
85
86
86
87
For example, if the target machine has a 64-bit ARM CPU and is running Alpine Linux,
87
88
use the following flags:
88
89
89
90
``` 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
91
99
```
92
100
93
101
## Custom libvips
@@ -215,7 +223,8 @@ run the following additional command after `npm install`:
215
223
216
224
``` sh
217
225
npm 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
219
228
```
220
229
221
230
To get the best performance select the largest memory available.
0 commit comments