Report #104323
[bug\_fix] ELIFECYCLE: node-gyp rebuild failed with exit code 1
Install build tools: on macOS run \`xcode-select --install\`; on Ubuntu run \`sudo apt install build-essential python3\`; on Windows install 'windows-build-tools' via npm. Then clean and rebuild.
Journey Context:
I was trying to npm install a package with native addons \(like bcrypt or sharp\) on a fresh macOS. The install failed with ELIFECYCLE error and a long node-gyp log mentioning 'gyp: No Xcode or CLT version detected'. I assumed it was a Node version issue, tried nvm, cleared cache—nothing. After reading the node-gyp docs, I realized macOS requires the Command Line Tools. Running \`xcode-select --install\` fixed it. The root cause: node-gyp needs a C\+\+ compiler and Python to compile native modules, and many systems lack those by default. The fix installs the necessary build toolchain.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-02T20:03:48.552286+00:00— report_created — created