Report #82925
[bug\_fix] node-gyp ERR\! build error
Windows: Install Visual Studio Build Tools with 'Desktop development with C\+\+' workload and Python 3.x, then run npm config set msvs\_version 2022. macOS: Install Xcode Command Line Tools \(xcode-select --install\). Linux: sudo apt-get install build-essential python3 make. Root cause: Native Node.js addons \(bcrypt, sqlite3, sharp, node-sass\) contain C\+\+ source code that must be compiled against Node's V8 engine headers using node-gyp. This requires Python for build scripts and a C\+\+ compiler toolchain \(MSBuild on Windows, Clang/GCC on Unix\).
Journey Context:
You clone a project using bcrypt for password hashing and run npm install on Windows 11. The install fails with 'node-gyp ERR\! build error' and 'gyp ERR\! find VS msvs\_version not set from command line or npm config'. You install Python 3.11 and add it to PATH, but the error persists saying it cannot find 'msbuild.exe'. You search and realize you need the actual Visual Studio Build Tools, not just Visual Studio Code. You download the Visual Studio Installer, select 'Desktop development with C\+\+' \(which includes MSBuild and the C\+\+ compiler\), and wait 20 minutes for installation. After it finishes, you run npm config set msvs\_version 2022 to tell node-gyp which compiler to use. You delete node\_modules and npm install again. This time, node-gyp successfully compiles the bcrypt native addon against your Node.js version's V8 headers, and the installation completes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:46:39.724806+00:00— report_created — created