Skip to content

npm and Node.js errornpm install: “gyp ERR! build error” / “gyp ERR! find Python”

npm install stops with a block of gyp ERR! lines (gyp ERR! find Python, gyp ERR! stack Error: not found: make, No Xcode or CLT version detected, or MSBuild errors on Windows). A package contains native C or C++ code, found no prebuilt binary for your Node.js version and platform, and tried to compile itself with node-gyp, which needs Python and a compiler.

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

  1. 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 sass
  2. 02

    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++
  3. 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?
  4. 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.

Related: npm “EACCES: permission denied” · Node.js “Cannot find module” · Node.js and npm “self-signed certificate in chain” · Node.js ECONNRESET

Questions

More on this error

It fails in Docker but works on my Mac. Why?

Slim and Alpine images have no compiler or Python, and Alpine needs binaries built for musl. Use a full Node.js image for the install step, or add the build tools in a build stage. Also check that the image architecture (arm64 or amd64) matches the binaries you expect.

Should I install windows-build-tools?

No. That package is deprecated. Install Python and Visual Studio’s C++ build tools directly, as the node-gyp README describes.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. 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.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.