Fix “xcode-select: error active developer directory” on Mac
Jun 06, 2025 am 10:00 AMA few Mac command line users working with nodejs and npm might encounter an error message and command failure similar to “xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance”. This error sometimes occurs after updating macOS, moving Macs, or
If you come across this error message, you’ll probably be able to resolve it quite easily.
Solution 1: Install Command Line Tools
The simplest solution is just to install command line tools on the Mac, which can be done from the command line. You can also install the complete Xcode suite from the Mac App Store if you prefer.
Launch Terminal and type the following command to start the Command Line Tools installation
xcode-select --install
Continue with the installation when prompted
This alone might fix the “xcode-select error xcodebuild requires Xcode” error message.
Solution 2: Adjust Directory for Command Line Tools
Occasionally, if you installed Xcode and Command Line Tools separately, you may need to re-specify the directory in use for command line tools by entering the following command into Terminal:
sudo xcode-select --switch /Library/Developer/CommandLineTools
Solution 3: Install Xcode and Adjust Location for Command Line Tools
Another method involves the full Xcode package which you can download from Apple.
- Open Xcode on the Mac, then go to the Xcode menu and select Preferences
- Navigate to “Locations” and pick the correct Command Line Tools
Solution 4: Install Xcode into /Applications, Adjust Directory Accordingly
Lastly, another approach that worked for some users when the previous methods didn’t, is to install Xcode from the Mac App Store into the /Applications/ directory on the Mac. Once Xcode is installed on the Mac, open Terminal and input the following path:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
–
Which of these techniques successfully fixed the “xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance” error message for you on your Mac? Did you discover a different solution? Share your thoughts in the comments.
The above is the detailed content of Fix “xcode-select: error active developer directory” on Mac. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To cut a screenshot on Mac:Open the screenshot, access the Markup Toolbar, click Crop, adjust the selection, and press Done.Open the image in Preview, select the area you want to keep, then go to Tools > Crop or press C

MacOS Sequoia's com.apple.mediaanalysisd directory cache files occupy a lot of disk space Some MacOS Sequoia users have found that the com.apple.mediaanalysisd directory in MacOS systems consumes a lot of disk space due to cache files. If you find that your Mac disk space is reduced after installing or updating to MacOS Sequoia, an oversized com.apple.mediaanalysisd cache file problem may be the culprit. Many Mac users report that the directory is full of 15GB or more data, some use

macOS Sequoia 15 release candidate is now available! Apple has released the macOS Sequoia 15 release candidate (RC) to Mac users involved in developers and public beta programs. At the same time, users of qualified device can also download iOS 18 RC, iPadOS 18 RC, watchOS 11 RC, tvOS 18 RC and visionOS 2 RC. If you have been waiting for the RC version or want to get the first to experience the version that will be released next Monday, you can now install macOS Sequoia RC through the developer beta or public beta program. Apple

In this article, we’ll run through the steps necessary to create a bootable installer of the Mac operating system, whether it’s so you can install the latest version of the macOS on multiple Macs, install the latest macOS beta, perform a c

A fair number of Mac users have discovered that Spotlight Search is not working well in MacOS Sequoia, either missing files, apps, and sometimes not working at all to find any local file. For some users the issues with Spotlight happens right after t

Apple has released MacOS Sequoia 15.3.1 update for Mac users running the Sequoia operating system. The new software update includes bug fixes and security enhancements, making it recommended for all users. Separately, Apple has released iOS 18.3.1 f

The heyday of your old Mac is over and it is just sitting there collecting dust? So, what to do with an old MacBook or iMac? Unless you want to turn it into a home decor item, you could use at least these 7 creative ways to turn it in

Personalize Your Safari Experience on MacBook: A Comprehensive Guide You can easily customize Safari on your MacBook to enhance your browsing experience. This guide provides a step-by-step approach to personalize various aspects of Safari, from the t
