Report #5389
[bug\_fix] gyp ERR\! build error gyp ERR\! stack Error: \`C:\\Program Files \(x86\)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe\` failed with exit code: 1
Install Visual Studio Build Tools 2019/2022 with the "Desktop development with C\+\+" workload, install Python 3.x, and configure npm: npm config set msvs\_version 2022. Alternatively, switch to packages with prebuilt binaries \(bcryptjs instead of bcrypt, sass instead of node-sass\). Root cause: node-gyp requires Python and a C\+\+ compiler to build native addons from source; Windows doesn't include these by default.
Journey Context:
Developer on Windows clones a project using bcrypt for password hashing. Running npm install fails with node-gyp rebuild errors mentioning missing MSBuild or Python. They install Python from python.org but errors persist because node-gyp expects specific Visual Studio Build Tools. They try npm install --global windows-build-tools \(now deprecated\), which hangs. The correct solution is downloading Build Tools for Visual Studio 2022, checking "Desktop development with C\+\+", then telling npm which version to use: npm config set msvs\_version 2022. The root cause is that native addons must be compiled from C\+\+ source, requiring a compiler toolchain Windows lacks by default. Alternatively, they could switch to bcryptjs which is pure JavaScript and requires no compilation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:11:58.630106+00:00— report_created — created