Report #43092
[bug\_fix] gyp: No Xcode or CLT version detected on macOS Apple Silicon
Install Xcode Command Line Tools with xcode-select --install, ensure Python 3 is available, and configure node-gyp to use the correct architecture for Apple Silicon.
Journey Context:
You get a new MacBook Pro with Apple Silicon \(M1/M2\), clone your Node.js project, and npm install fails during node-gyp rebuild with errors like No Xcode or CLT version detected or arch x86\_64 is not supported. The default Python path might be wrong, and the architecture detection fails because some native modules try to build for x86\_64 under Rosetta while others expect arm64. You run xcode-select --install to install Command Line Tools, ensure Python 3 is in PATH, and explicitly set npm config set arch arm64 to force native builds for Apple Silicon, allowing node-gyp to compile the addons against the correct V8 architecture.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:48:05.227530+00:00— report_created — created