Short answer
Find which package is building (its name is in the lines above gyp ERR!). If it is an old package such as node-sass or an outdated bcrypt or sqlite3, upgrading it or switching to a pure JavaScript alternative (sass, bcryptjs) is often the real fix. Otherwise install the build tools: Xcode Command Line Tools on macOS (xcode-select --install), Python, make and a C++ compiler on Linux, and Python plus Visual Studio’s C++ build tools on Windows. With Python 3.12 or newer, node-gyp must be version 10 or later.
Why the native build failed, and the fix
01
No prebuilt binary for your Node.js version
Native packages usually download a prebuilt binary and only compile as a fallback. A brand-new Node.js version, or an old package version with no binaries for it, triggers the compile. Upgrade the package, or use the Node.js LTS version it supports.
npm ls node-sass bcrypt sqlite3 # which native package is it? npm uninstall node-sass && npm install sass02
Build tools missing on macOS or Linux
“Install the Xcode Command Line Tools standalone by running xcode-select --install.” node-gyp, node-gyp: installation on macOS
macOS needs the Xcode Command Line Tools; after a macOS update they sometimes need reinstalling. Linux needs Python, make and a C/C++ compiler.
# macOS xcode-select --install # Debian / Ubuntu sudo apt-get update && sudo apt-get install -y python3 make g++03
Python 3.12 and an old node-gyp
“Python >= v3.12 requires node-gyp >= v10” node-gyp, node-gyp: installation
Python 3.12 removed a module older node-gyp versions relied on, so the build fails even with Python installed. Update npm (which bundles node-gyp) or the package that pins an old node-gyp.
npm install -g npm@latest npm explain node-gyp # who pulls in an old version?04
Windows without the C++ build tools
On Windows, node-gyp needs Python and Visual Studio (or Build Tools for Visual Studio) with the Desktop development with C++ workload. The Node.js Windows installer can add these with its Tools for Native Modules option. Install both, then open a new terminal and run npm install again.
Checked against the vendor’s docs on : node-gyp: README (installation).
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
Related: npm “EACCES: permission denied” · Node.js “Cannot find module” · Node.js and npm “self-signed certificate in chain” · Node.js ECONNRESET