Report #99589
[bug\_fix] node-gyp ERR\! stack Error: Could not find any Python installation to use
Install the native build toolchain: on Debian/Ubuntu run \`sudo apt-get install -y build-essential python3 make g\+\+\`; on macOS run \`xcode-select --install\` and install the full Xcode CLI tools; on Windows use \`npm install --global windows-build-tools\` or Visual Studio Build Tools with "Desktop development with C\+\+". Then reinstall the package so node-gyp can compile native bindings.
Journey Context:
You run \`npm install\` on a project that depends on bcrypt. The install fails deep inside node-gyp with "Could not find any Python installation to use" and a cascade of C\+\+ compiler errors. You first suspect bcrypt itself is broken and try switching to bcryptjs, but the next native dependency hits the same wall. Reading the node-gyp README reveals that packages with C\+\+ add-ons require Python 3 and a C\+\+ compiler to build from source. On your fresh Ubuntu container neither is present. After installing build-essential and python3, the compilation succeeds and the install finishes. You later switch to a Docker image that already ships these tools to avoid repeating the setup.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:43:43.199101+00:00— report_created — created