Report #14006
[bug\_fix] gyp ERR\! find Python / gyp ERR\! find VS msvs\_version not set from command line or npm config
On Windows: Install Visual Studio Build Tools with "Desktop development with C\+\+" workload and Python 3.x, then run npm config set msvs\_version 2022 and npm config set python python3. On Linux: sudo apt-get install python3 make g\+\+. Root cause: node-gyp is a cross-platform tool that compiles native C\+\+ addons for Node.js; it requires Python to run its build scripts and a C\+\+ compiler \(MSVC on Windows, GCC/Clang on Unix\) to compile the native code.
Journey Context:
A developer on a fresh Windows 11 machine clones a project using bcrypt for password hashing. They run npm install. The installation proceeds until the postinstall script for bcrypt, then crashes with "gyp ERR\! stack Error: Can't find Python executable 'python'". The developer installs Python 3.11 from python.org and adds it to PATH. Runs npm install again. Now it fails with "gyp ERR\! find VS could not find any Visual Studio installation". The developer realizes they need the C\+\+ compiler, not just Python. They download Visual Studio Community 2022 \(several GB\) but still get errors about "msvs\_version not set". They then find the node-gyp documentation stating that only the "Build Tools" are needed, not the full IDE. They uninstall VS Community, install "Build Tools for Visual Studio 2022" with the "Desktop development with C\+\+" workload \(~3GB\). Then run npm config set msvs\_version 2022 and npm config set python C:\\Users\\name\\AppData\\Local\\Programs\\Python\\Python311\\python.exe. Finally npm install succeeds. The fix works because node-gyp uses Python to generate build files \(like Makefile or .sln\) and then invokes the native compiler \(MSVC cl.exe\) to build the .node binary; without these tools, the build cannot proceed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:21:21.073663+00:00— report_created — created