ホーム>Other>How to Fix 'xcode-select: note: No developer tools were found, requesting install'
Other

How to Fix 'xcode-select: note: No developer tools were found, requesting install'

Thank you for your continued support.
This article contains advertisements, including affiliate links, that help fund our operations.
As an Amazon Associate, Laratech earns from qualifying purchases.

'xcode-select: note: No developer tools were found, requesting install.' means Command Line Tools isn't installed on your Mac. Running xcode-select --install fixed it for me. Also covers Xcode in a non-default location, installing without the dialog, and the xcrun error after a macOS update.

Error Message

xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See man xcode-select for more details.

This shows up the first time you run a command that needs a compiler in the terminal — git, make, Homebrew, and the like.

Cause

This happens because Xcode Command Line Tools isn't installed.

It's not specific to M4 Macs — it happens on any Mac right after the initial macOS setup, or right after a clean install of the OS.

Command Line Tools includes git, clang (the C compiler), make, and more. It's also used internally when installing Homebrew or any package that needs to be built.

Solution (What Actually Fixed It for Me)

I hit this error on an M4 Mac, and just running:

xcode-select --install

fixed it.

That's it — this installs Command Line Tools.

Honestly, I wish the error message itself had just said that.

How to Check It Installed

xcode-select -p

If this prints a path like /Library/Developer/CommandLineTools, you're set.

By the Way

Apparently you can also install Xcode itself from the App Store, but it takes up quite a lot of disk space, so it seems like a lot of people avoid that route.

From my memory of the Intel chip era, it felt like the Mac just worked out of the box without any of this. What a pain.

But the M4 builds so much faster that I'll forgive it.

Reference: If xcode-select --install Doesn't Fix It

The Second Line of the Error: Xcode in a Non-Default Location

The second line of the error says: if your developer tools are somewhere other than the default location, point to that Xcode with sudo xcode-select --switch path/to/Xcode.app and cancel the installation dialog.

This seems to apply if you keep Xcode itself somewhere other than /Applications. Apple's Technical Note TN2339 also describes selecting the Xcode to use with the switch option of xcode-select. Following the wording in the error, it would look like this:

sudo xcode-select --switch /Applications/Xcode.app

Replace /Applications/Xcode.app with wherever your Xcode actually is. You can apparently confirm the result with xcode-select -p, shown above.

If you don't have Xcode installed, you can likely ignore the second line and just run xcode-select --install.

If You Can't Install from the Dialog

According to the same technical note, besides xcode-select --install, you can download the Command Line Tools package from Apple's developer download page (you need to sign in with your Apple ID) and install it from there.

Homebrew's installation docs also list both xcode-select --install and https://developer.apple.com/download/all/ as places to get the Command Line Tools.

"xcrun: error: invalid active developer path" After a macOS Update

On the Apple Developer Forums, people report errors like this from git and similar commands after updating macOS:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

In that thread, an Apple engineer replies that if you haven't reinstalled the command-line tools since then, you should, and several people report that xcode-select --install fixed it.

Another user reports that sudo xcode-select --reset (which resets the selection to the default) fixed it, but that's a user post, not Apple's official guidance.

If You Just Want Homebrew

According to Homebrew's installation docs, the Command Line Tools (or Xcode) are needed to build packages from source, and on Apple Silicon Macs (M1–M4, etc.) bottles (prebuilt packages) and casks can be installed without developer tools.

That said, you need the Command Line Tools to use git, so installing them up front seems like the safe choice.

Sources

Summary

If you're trying to use git or similar tools for the first time on a new Mac, or right after a clean install, you'll almost certainly run into this error.

In my case, running xcode-select --install was all it took.

If you keep Xcode in a non-default location, or the error showed up after a macOS update, check the Reference section above.

Please Provide Feedback
We would appreciate your feedback on this article. Feel free to leave a comment on any relevant YouTube video or reach out through the contact form. Thank you!