Possible install-time or require-time problem
Are you using the latest version of sharp?
Are you using a supported runtime?
Are you using a supported package manager and installing optional dependencies?
What is the complete error message, including the full stack trace?
When libvips is globally installed (e.g. via brew install vips), sharp attempts to build from source instead of using prebuilt binaries. This fails on Node.js 24 LTS:
sharp: Attempting to build from source via node-gyp
sharp: Detected globally-installed libvips v8.18.0
../metadata.cc:259:46: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
../metadata.cc:262:45: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
../metadata.cc:265:46: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
../metadata.cc:272:45: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
../metadata.cc:276:31: error: no member named 'NewOrCopy' in 'Napi::Buffer<char>'
5 errors generated.
make: *** [Release/obj.target/sharp-darwin-arm64/metadata.o] Error 1
gyp ERR! build error
What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?
Details
sharp: Attempting to build from source via node-gyp
sharp: See https://sharp.pixelplumbing.com/install#building-from-source
sharp: Please add node-addon-api to your dependencies
npm error code 1
npm error path /private/tmp/sharp-test/node_modules/sharp
npm error command failed
npm error command sh -c node install/check.js || npm run build
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
System:
OS: macOS 26.2
CPU: (10) arm64 Apple M1 Pro
Memory: 110.91 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.13.0
npm: 11.6.2
Workaround: SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install sharp forces prebuilt binary download and succeeds.
Possible install-time or require-time problem
Are you using the latest version of sharp?
sharpas reported bynpm view sharp dist-tags.latest(0.34.5).Are you using a supported runtime?
^18.17.0 || ^20.3.0 || >=21.0.0Are you using a supported package manager and installing optional dependencies?
--include=optionalWhat is the complete error message, including the full stack trace?
When
libvipsis globally installed (e.g. viabrew install vips), sharp attempts to build from source instead of using prebuilt binaries. This fails on Node.js 24 LTS:What is the complete output of running
npm install --verbose --foreground-scripts sharpin an empty directory?Details
What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?Workaround:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install sharpforces prebuilt binary download and succeeds.