gyp ERR! build error / node-gyp rebuild failed
A dependency with native C/C++ code couldn’t compile — missing build tools, Python, or an unsupported Node version.
Meaning
Packages like bcrypt, sqlite3, canvas, sharp (older versions) and node-sass compile native addons at install time if no prebuilt binary exists for your OS/Node version.
Common causes
- No C++ toolchain (build-essential, Xcode Command Line Tools, Visual Studio Build Tools)
- Python missing or wrong version for node-gyp
- Node version too new for the package (no prebuilt binary)
- Deprecated packages (node-sass) that no longer build
⚡ Quick fix
- Install build tools for your OS (below)
- Upgrade the package to a version with prebuilt binaries
- Use a supported Node LTS version (
nvm use --lts) - Replace node-sass with
sass, bcrypt withbcryptjsif needed
Detailed fix by platform
Linux
- Debian/Ubuntu:bash
sudo apt install -y build-essential python3 make g++
iOS
- macOS:
xcode-select --installfor the Command Line Tools.
Windows
- Install “Desktop development with C++” from Visual Studio Build Tools, then
npm config set msvs_version 2022.
How to diagnose
- Package — Which package is compiling?
- Toolchain — Compiler and Python available?
- Node version — Supported by that package version?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026