Report #104641
[bug\_fix] ELIFECYCLE: Command failed with exit code 1 while building node-gyp
Install Windows build tools using \`npm install --global windows-build-tools\` \(legacy\) or install Visual Studio Build Tools with the 'Desktop development with C\+\+' workload, then retry.
Journey Context:
I tried to install a native module \(bcrypt\) on a fresh Windows 11 machine. \`npm install\` started the node-gyp rebuild step and failed with ELIFECYCLE, exit code 1. The error output showed it couldn't find either Python or Visual Studio C\+\+ compiler. Node-gyp requires a C\+\+ compiler and Python 2.7 or 3.x. Initially, I installed Python from the Microsoft Store but forgot to set the path. I then ran \`npm install --global windows-build-tools\` which installs Python and the Visual Studio Build Tools silently. After that, \`npm rebuild bcrypt\` succeeded. The root cause is that Windows doesn't ship with the necessary build tools; node-gyp expects them to be present. The fix ensures the required toolchain is installed and available in PATH.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-20T20:03:17.227045+00:00— report_created — created