How to fix npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR! node-pre-gyp ERR! Pre-built binaries not found in npm

npmINTERMEDIATEMEDIUMUpdated Dec 6, 2025· 122 views

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.

Quick fix

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 --install
  1. Install build tools for fallback compilation
  2. Force build from source
  3. Try a different Node.js version
  4. Clean and reinstall
npm — error
xcode-select --install
npm ERR! node-pre-gyp ERR! Tried to download: binary package
npm ERR! node-pre-gyp ERR! Pre-built binaries not found

What this error means

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.

Typical symptoms

  • npm install shows "Pre-built binaries not found"
  • Warning about downloading binary followed by build error
  • Installation hangs during compilation phase
  • Works on common platforms but fails on less common ones
  • Fails after upgrading Node.js to a new version
  • Works on Linux but fails on macOS or vice versa

Common causes

  1. No prebuilt binary for your Node.js version
  2. No prebuilt binary for your platform (especially Apple Silicon)
  3. Missing build tools for source compilation fallback
  4. Network issues preventing binary download
  5. Outdated package with limited binary support
  6. Proxy blocking binary downloads

How to fix "npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR! node-pre-gyp ERR! Pre-built binaries not found"

1Install build tools for fallback compilation

When binaries aren't available, npm compiles from source:

macOS:

bash
xcode-select --install

Ubuntu/Debian:

bash
sudo apt-get install build-essential python3

Windows:

bash
npm install -g windows-build-tools

Alpine Linux:

bash
apk add python3 make g++
2Force build from source

Explicitly compile instead of downloading:

bash
# Build from source
npm install <package-name> --build-from-source

# For all packages
npm rebuild --build-from-source
3Try a different Node.js version

Prebuilt binaries may exist for other versions:

bash
# List available Node versions
nvm ls-remote --lts

# Try an LTS version
nvm install 18
nvm use 18

# Reinstall
rm -rf node_modules && npm install

LTS versions typically have more prebuilt binaries available.

4Clean and reinstall

Clear cached state:

bash
# Remove node_modules and lockfile
rm -rf node_modules package-lock.json

# Clear npm cache
npm cache clean --force

# Reinstall
npm install
5Check network/proxy settings

Binary downloads may be blocked:

bash
# 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:8080
6Update the package

Newer versions may have more binaries:

bash
# Update specific package
npm update <package-name>

# Or install latest
npm install <package-name>@latest

Advanced notes

Common 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.

Frequently asked questions

What does "npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR!" mean?
Node-pre-gyp tries to download precompiled binaries for native modules instead of compiling from source. 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.
How do I fix "npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR!"?
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.
What causes "npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR!"?
No prebuilt binary for your Node.js version No prebuilt binary for your platform (especially Apple Silicon) Missing build tools for source compilation fallback
Is the "npm ERR! node-pre-gyp ERR! Tried to download: binary package npm ERR!" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading