How to fix npm ERR! prebuild-install WARN install No prebuilt binaries found in npm
This warning occurs when prebuild-install can't find prebuilt binaries for your platform/Node.js combination. It falls back to compiling from source, which requires build tools.
Quick fix
Fixes npm ERR! prebuild-install WARN install No prebuilt binaries found
sudo apt-get update
sudo apt-get install -y build-essential python3- Install build tools for fallback compilation
- Try a supported Node.js version
- Check package's supported platforms
- Use a pure JavaScript alternative
sudo apt-get updatesudo apt-get install -y build-essential python3npm ERR! prebuild-install WARN install No prebuilt binaries found
What this error means
The "No prebuilt binaries found" message is actually a warning, not an error. It means prebuild-install couldn't find a pre-compiled binary for your specific combination of: - Node.js version - Operating system (Linux, macOS, Windows) - CPU architecture (x64, arm64, arm) - C library (glibc, musl) When this happens, npm falls back to compiling the native module from source using node-gyp. The actual error occurs if this compilation fails—usually because build tools aren't installed. Many packages use prebuild-install to provide faster installations by distributing pre-compiled binaries, but they can't cover every possible platform/version combination.
Typical symptoms
- Warning about 'No prebuilt binaries found' during npm install
- Installation takes longer than expected (compiling from source)
- Fails if build tools aren't installed
- Works on some machines but not others
Common causes
- Node.js version not supported by package's prebuilt binaries
- Unsupported platform/architecture (ARM, Apple Silicon, Alpine Linux)
- Package hasn't published binaries for latest Node.js version
- Build tools not installed for fallback compilation
- Musl libc (Alpine) instead of glibc (most Linux distros)
How to fix "npm ERR! prebuild-install WARN install No prebuilt binaries found"
The warning itself isn't the problem—the issue is if compilation fails. Install build tools:
Linux (Debian/Ubuntu):
sudo apt-get update
sudo apt-get install -y build-essential python3macOS:
xcode-select --installWindows:
npm install --global --production windows-build-toolsAlpine Linux (Docker):
RUN apk add --no-cache python3 make g++Packages often have prebuilt binaries for LTS versions. Try switching:
# Check current version
node --version
# Use nvm to switch to LTS
nvm install --lts
nvm use --lts
# Clean reinstall
rm -rf node_modules package-lock.json
npm installLTS versions (16, 18, 20) typically have better prebuilt binary coverage.
Some packages don't support all platforms. Check the package's GitHub releases or npm page for available binaries.
Common unsupported combinations:
- Alpine Linux (musl libc instead of glibc)
- ARM architecture (Raspberry Pi, AWS Graviton)
- Apple Silicon (M1/M2) on older package versions
- Very new Node.js versions
If compilation keeps failing, consider JavaScript alternatives:
| Native Package | JS Alternative |
|---------------|----------------|
| bcrypt | bcryptjs |
| sqlite3 | sql.js, better-sqlite3 |
| sharp | jimp |
| node-sass | sass (dart-sass) |
These don't require compilation and work everywhere.
Sometimes cached data causes issues:
npm cache clean --force
rm -rf node_modules package-lock.json
npm installAdvanced notes
This is a warning, not an error: The "No prebuilt binaries found" message just means npm will compile from source. Installation only fails if compilation fails.
Docker considerations: Use multi-stage builds to compile in a full image and copy to slim:
FROM node:20 AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y build-essential python3
COPY package*.json ./
RUN npm ci
FROM node:20-slim
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modulesApple Silicon (M1/M2): Older packages may not have arm64 binaries. Try:
arch -x86_64 npm installThis runs npm under Rosetta 2.
CI/CD optimization: If builds are slow due to compilation, consider caching node_modules or using a base image with preinstalled build tools.
Frequently asked questions
- What does "npm ERR! prebuild-install WARN install No prebuilt binaries found" mean?
- The "No prebuilt binaries found" message is actually a warning, not an error. js version - Operating system (Linux, macOS, Windows) - CPU architecture (x64, arm64, arm) - C library (glibc, musl) When this happens, npm falls back to compiling the native module from source using node-gyp. The actual error occurs if this compilation fails—usually because build tools aren't installed.
- How do I fix "npm ERR! prebuild-install WARN install No prebuilt binaries found"?
- This warning occurs when prebuild-install can't find prebuilt binaries for your platform/Node.js combination. It falls back to compiling from source, which requires build tools.
- What causes "npm ERR! prebuild-install WARN install No prebuilt binaries found"?
- Node.js version not supported by package's prebuilt binaries Unsupported platform/architecture (ARM, Apple Silicon, Alpine Linux) Package hasn't published binaries for latest Node.js version
- Is the "npm ERR! prebuild-install WARN install No prebuilt binaries found" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚npm Official Documentation
- 🐙GitHub: prebuild-install(GitHub)
- 🐙GitHub: node-gyp(GitHub)
- 💬SO: prebuild issues(Stack Overflow)