Report #57357
[bug\_fix] gyp ERR\! build error
Install Visual Studio Build Tools \(Windows\) or Xcode Command Line Tools \(macOS\), ensure Python 3 is installed and in PATH, and configure npm with npm config set msvs\_version 2022 \(or appropriate version\).
Journey Context:
Developer on Windows clones a repository containing native Node.js addons such as bcrypt, sharp, or sqlite3. Running npm install triggers node-gyp which attempts to compile C\+\+ source files. The installation fails with "gyp ERR\! build error" and "MSBuild not found" or "Python executable not found." Developer reads the node-gyp documentation and realizes that compiling native addons requires Python and a C\+\+ compiler. Developer installs Python 3 from python.org and checks "Add to PATH." Developer then installs Visual Studio Build Tools 2022 with the "Desktop development with C\+\+" workload selected \(or runs npm install --global windows-build-tools on older setups\). Developer configures npm to use the correct Visual Studio version: npm config set msvs\_version 2022. After these steps, npm install successfully compiles the native modules.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:45:45.228500+00:00— report_created — created