Error DictionaryLast Updated: Jan 31, 2026

Fix: gyp: No Xcode or CLT version detected

Step-by-step fix for the 'gyp: No Xcode or CLT version detected' error when installing OpenClaw on macOS or Windows.

This page helps you fix the build error that occurs during npm install.


🔴 Raw Error Log (What You Actually See)

You may see one or more of these messages in your terminal:

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! not ok
npm ERR! code ELIFECYCLE

Or on Windows:

gyp ERR! find Python
gyp ERR! stack Error: Could not find any Python installation

If your error looks similar, you are in the right place.


🔍 Why This Happens (Root Cause)

OpenClaw uses native Node.js modules (like better-sqlite3 or sharp) that need to be compiled from C++ source code.

Your computer is missing the Build Tools required to compile them:

  • macOS — Xcode Command Line Tools
  • Windows — Visual Studio Build Tools + Python

✅ How to Fix It (Step-by-Step)

macOS Users

Step 1 — Install Xcode Command Line Tools

Open Terminal and run:

xcode-select --install

A popup window will appear. Click Install and wait for it to complete.

Step 2 — If Already Installed But Still Failing

Reset the tools and reinstall:

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

Step 3 — Reinstall Dependencies

rm -rf node_modules package-lock.json
npm install

Windows Users

Step 1 — Install Windows Build Tools

Open PowerShell as Administrator and run:

npm install --global --production windows-build-tools

⚠️ This may take 5-10 minutes. It installs Python and Visual Studio Build Tools.

Step 2 — Reinstall Dependencies

Remove-Item -Recurse -Force node_modules
Remove-Item package-lock.json
npm install

🔎 Verify the Fix

After applying the fix, run:

npm install

✅ Expected Result

The installation should complete without gyp ERR! messages:

added 342 packages in 45s

❌ Still Not Working?


🧭 Advanced Notes

Apple Silicon (M1/M2/M3) Users:

If you're on Apple Silicon and still having issues, try:

arch -x86_64 npm install

This forces npm to use x86 compatibility mode.


🔗 Related: Common Errors Summary | Error Dictionary

Internal Ref: ERROR_INSTALL_001
ErrorInstallationgypXcodemacOSWindows