Report #75799
[bug\_fix] gyp ERR\! stack Error: Can't find Python executable "python", you can set the PYTHON env variable
Install Python 3.x and run \`npm config set python /usr/bin/python3\` \(or \`python3\` on PATH\), then delete \`node\_modules\` and reinstall. On Windows, install \`windows-build-tools\` or Visual Studio Build Tools. Root cause: \`node-gyp\` requires Python 3 to generate platform-specific build files for native C\+\+ addons.
Journey Context:
Developer clones a repository using \`bcrypt\` or \`sharp\` on a fresh macOS machine. Running \`npm install\` fails during the postinstall phase with "gyp ERR\! find Python". They realize they only have Xcode Command Line Tools but not Python 3 \(macOS 12.3\+ removed Python 2.7\). They try \`sudo npm install -g node-gyp\` which doesn't help. Checking the \`node-gyp\` GitHub README, they see Python 3.7\+ is mandatory. After \`brew install python\`, they set \`npm config set python $\(which python3\)\`, delete \`node\_modules\` to clear the failed state, and reinstall. The native module now compiles using the correct Python interpreter.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:49:37.658356+00:00— report_created — created