The "Pre-built binaries not found" error occurs when no precompiled binary exists for your platform/Node version. Install build tools to compile from source as a fallback.
Fixes npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR! node-pre-gyp ERR! Pre-built binaries not found
xcode-select --installxcode-select --installnpm ERR! node-pre-gyp ERR! Tried to download: binary packagenpm ERR! node-pre-gyp ERR! Pre-built binaries not found
Node-pre-gyp tries to download precompiled binaries for native modules instead of compiling from source. This error means no binary exists for your specific combination of Node.js version, operating system, and CPU architecture. When prebuilt binaries aren't available, node-pre-gyp falls back to compiling from source—which fails if you don't have build tools installed.
When binaries aren't available, npm compiles from source:
macOS:
xcode-select --installUbuntu/Debian:
sudo apt-get install build-essential python3Windows:
npm install -g windows-build-toolsAlpine Linux:
apk add python3 make g++Explicitly compile instead of downloading:
# Build from source
npm install <package-name> --build-from-source
# For all packages
npm rebuild --build-from-sourcePrebuilt binaries may exist for other versions:
# List available Node versions
nvm ls-remote --lts
# Try an LTS version
nvm install 18
nvm use 18
# Reinstall
rm -rf node_modules && npm installLTS versions typically have more prebuilt binaries available.
Clear cached state:
# Remove node_modules and lockfile
rm -rf node_modules package-lock.json
# Clear npm cache
npm cache clean --force
# Reinstall
npm installBinary downloads may be blocked:
# Test npm registry access
npm ping
# If behind proxy, configure it
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080Newer versions may have more binaries:
# Update specific package
npm update <package-name>
# Or install latest
npm install <package-name>@latestCommon packages using node-pre-gyp: grpc, canvas, bcrypt, sqlite3, node-sass.
For Apple Silicon (M1/M2) Macs, many older packages lack arm64 binaries. Options:
1. Use Rosetta: arch -x86_64 npm install
2. Compile from source with build tools installed
3. Use newer package versions with arm64 support
For CI/CD, ensure your build environment has the same architecture as production. Cross-compilation issues are common.
The modern alternative to node-pre-gyp is prebuildify, which ships binaries inside the npm package—eliminating download issues entirely.