Report #15523
[bug\_fix] gyp ERR\! build error gyp ERR\! stack Error: \`gyp\` failed with exit code: 1 gyp ERR\! stack at ChildProcess.onExit \(/usr/local/lib/node\_modules/npm/node\_modules/node-gyp/lib/build.js:203:23\) ... Error: Cannot find module 'bcrypt'
Install the platform-specific build toolchain: on Windows, install \`windows-build-tools\` via \`npm install --global windows-build-tools\` or Visual Studio Build Tools with 'Desktop development with C\+\+' workload; on macOS, run \`xcode-select --install\` to install Xcode Command Line Tools; on Linux, install \`python3\`, \`make\`, and \`gcc/g\+\+\` \(e.g., \`build-essential\` on Ubuntu\). The root cause is that native C\+\+ addons must be compiled against specific Node.js headers using Python and a C\+\+ compiler, which are not bundled with the Node.js runtime.
Journey Context:
A developer clones a project using \`bcrypt\` or \`sharp\` on a fresh Windows machine. Running \`npm install\` proceeds until node-gyp attempts to compile the native addon, then fails with 'Can't find Python executable' or 'MSBuild not found'. The developer initially tries reinstalling Node.js or switching versions with nvm. They then search the error and land on the node-gyp repository issues. They learn that node-gyp is a separate build tool that requires Python and C\+\+ compiler. On Windows, they download the massive Visual Studio Build Tools installer, select the C\+\+ workload, and wait for the multi-GB install. Alternatively, they might use the now-deprecated but convenient \`npm install --global windows-build-tools\`. Once the toolchain is present, they delete node\_modules and reinstall, watching node-gyp successfully compile the \`.node\` binary against the current Node.js version headers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:21:16.626403+00:00— report_created — created