Report #37664
[bug\_fix] node-gyp rebuild fails with MSBuild.exe or Python not found
On Windows: Install Visual Studio Build Tools with the "Desktop development with C\+\+" workload, then npm config set msvs\_version 2022. On Linux/macOS: Install python3, make, and gcc/g\+\+ \(build-essential on Debian\). Alternatively, use a Docker image or npm package that provides prebuilt binaries to avoid compilation.
Journey Context:
Developer clones a project using bcrypt, sqlite3, or another native Node addon on a fresh Windows machine. Runs npm install. It fails with gyp ERR\! find Python or gyp ERR\! find VS msvs\_version not set. They install Python 3 from python.org, but the error persists because node-gyp actually requires the Visual Studio C\+\+ compiler \(MSBuild\), not just Python. They download Visual Studio Build Tools \(not the full IDE\), run the installer, select "Desktop development with C\+\+" which includes MSBuild and the C\+\+ standard library. They run npm config set msvs\_version 2022 to tell node-gyp which version to use. npm install now successfully compiles the native addon. On a Linux server, they would have needed apt-get install build-essential python3 instead.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:41:55.606875+00:00— report_created — created