@@ -20,10 +20,6 @@ npm install sharp
2020pnpm add sharp
2121```
2222
23- When using ` pnpm ` , add ` sharp ` to
24- [ ignoredBuiltDependencies] ( https://pnpm.io/settings#ignoredbuiltdependencies )
25- to silence warnings.
26-
2723``` sh frame="none"
2824yarn add sharp
2925```
@@ -112,13 +108,13 @@ and on macOS when running Node.js under Rosetta.
112108
113109## Building from source
114110
115- This module will be compiled from source when:
116-
117- * a globally-installed libvips is detected, or
118- * using ` npm explore sharp -- npm run build ` , or
119- * using the deprecated ` npm run --build-from-source ` at ` npm install ` time.
111+ ``` sh frame="none"
112+ npm install sharp
113+ npm explore sharp -- npm run build
114+ ```
120115
121- The logic to detect a globally-installed libvips can be skipped by setting the
116+ The build process will search for a globally-installed libvips.
117+ This detection logic can be skipped by setting the
122118` SHARP_IGNORE_GLOBAL_LIBVIPS ` (never try to use it) or
123119` SHARP_FORCE_GLOBAL_LIBVIPS ` (always try to use it, even when missing or outdated)
124120environment variables.
@@ -129,21 +125,12 @@ Building from source requires:
129125* [ node-addon-api] ( https://www.npmjs.com/package/node-addon-api ) version 7+
130126* [ node-gyp] ( https://github.com/nodejs/node-gyp#installation ) version 9+ and its dependencies
131127
132- There is an install-time check for these dependencies.
133128If ` node-addon-api ` or ` node-gyp ` cannot be found, try adding them via:
134129
135130``` sh frame="none"
136131npm install --save node-addon-api node-gyp
137132```
138133
139- When using ` pnpm ` , you may need to add ` sharp ` to
140- [ onlyBuiltDependencies] ( https://pnpm.io/settings#onlybuiltdependencies )
141- to ensure the installation script can be run.
142-
143- For cross-compiling, the ` --platform ` , ` --arch ` and ` --libc ` npm flags
144- (or the ` npm_config_platform ` , ` npm_config_arch ` and ` npm_config_libc ` environment variables)
145- can be used to configure the target environment.
146-
147134## WebAssembly
148135
149136Experimental support is provided for runtime environments that provide
@@ -166,10 +153,8 @@ as well as the additional [building from source](#building-from-source) dependen
166153
167154``` sh frame="none"
168155pkg install -y pkgconf vips
169- ```
170-
171- ``` sh frame="none"
172- cd /usr/ports/graphics/vips/ && make install clean
156+ npm install sharp
157+ npm explore sharp -- npm run build
173158```
174159
175160## Linux memory allocator
0 commit comments