Report #38466
[bug\_fix] gyp ERR\! stack Error: \`gyp\` failed with exit code: 1; MSB4019: The imported project "C:\\Microsoft.Cpp.Default.props" was not found
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
Journey Context:
Developer runs npm install on Windows for a package with native bindings \(bcrypt, sharp, sqlite3\). It fails with node-gyp errors mentioning missing Python executable or VCBUILD.exe. The developer installs Python 2.7 \(wrong version\), then tries windows-build-tools which hangs. The error persists because node-gyp requires Python 3 and specific C\+\+ compilers to compile C\+\+ addons against Node's V8 headers. The journey involves reading node-gyp documentation to learn it uses GYP \(Generate Your Projects\) to create Visual Studio project files. The fix requires downloading Visual Studio Build Tools 2022, installing the "Desktop development with C\+\+" workload \(not just the VS Code C\+\+ extension\), then configuring npm to use these tools. This works because node-gyp runs Python scripts to generate .vcxproj files, then invokes MSBuild.exe \(located via msvs\_version\) to compile the C\+\+ source into a .node binary linked against the current Node process's NODE\_MODULE\_VERSION ABI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:02:17.920955+00:00— report_created — created