Report #4056
[bug\_fix] node-gyp rebuild failed: gyp ERR\! find Python / gyp ERR\! find VS / make failed with exit code 2
Root cause: Native Node.js modules \(C\+\+ addons\) must be compiled from source using node-gyp, which requires Python \(2.7 or 3.x\), a C\+\+ compiler, and make/MSBuild. The fix depends on the OS: On Windows, install windows-build-tools \(npm install --global windows-build-tools\) or Visual Studio Build Tools with the 'Desktop development with C\+\+' workload. On macOS, install Xcode Command Line Tools \(xcode-select --install\). On Linux, install build-essential, python3, and make \(apt-get install -y build-essential python3 make\). Alternatively, switch to pure-JS alternatives or ensure prebuilt binaries are available for your Node version.
Journey Context:
Developer runs npm install and it fails while trying to build a native package like bcrypt, sqlite3, or sharp. The error shows 'node-gyp rebuild' failing with messages like 'gyp ERR\! find Python' or 'gyp ERR\! stack Error: not found: make' or on Windows 'MSBuild not found'. Developer tries installing the latest Python but it doesn't help because node-gyp specifically needs Python 2.7 or 3.x with specific env vars. On Windows, they try installing Visual Studio but the wrong workload. The rabbit hole involves realizing that native modules need to be compiled against the current Node.js ABI \(Application Binary Interface\), which requires a full build toolchain: C\+\+ compiler \(gcc/clang/MSVC\), Python for the build scripts, and make/ninja. Developer eventually finds that the issue isn't their code but missing system dependencies required by node-gyp.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:44:26.710117+00:00— report_created — created