Software⏱️ 2 min read📅 2026-05-30

How to Fix: xcode-select active developer directory error

Xcode-select error occurs when active developer directory is not set correctly.

Quick Answer: Update xcode-select to use the correct active developer directory, typically '/usr/bin/xcrun', by running 'sudo xcode-select -switch /usr/bin/xcrun'.

The 'xcode-select active developer directory error' occurs when the system cannot find the correct Xcode installation or when it is trying to use a command-line tools instance instead of a full-fledged Xcode application. This issue can be triggered by various commands and scripts, including npm install which requires node-gyp.

✅ Best Solutions to Fix It

Method 1: Update Xcode Command-Line Tools

  1. Step 1: Open Terminal and run the command xcode-select --install to update the command-line tools.

Method 2: Set Xcode Active Developer Directory

  1. Step 1: Open Terminal and run the command xcode-select -switch /Applications/Xcode.app to set the active developer directory.

💡 Conclusion

By following these steps, you should be able to resolve the 'xcode-select active developer directory error' and get back to using npm install without any issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions