How to Fix "xcrun error invalid active developer path" with Git on macOS
I ran an update on macOS and came across this error when running a
git pull command.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
The issue is that Xcode Command-line Tools needs to be installed or updated, and we need to explicitly agree to the license agreement.
Solution 1: Xcode not installed
via the command line
First, let’s open the terminal and run this install command.
We’ll see this output:
xcode-select: note: install requested for command line developer tools.
And then we should be prompted with another window to confirm this action.
Once the install completes, we can open a new terminal to test our
If the problem persists, we can attempt running a reset afterward.
sudo xcode-select --reset
via the Apple Developer download page
xcode-select --install can’t find the software, we can download the command line tool manually.
Let’s head over to the Apple Developer’s Download Page. We’ll be prompted to sign up or log in.
We can search for the appropriate
Command Line Tools for (macOS xx.x) Xcode xx.x and download the
Solution 2: Xcode installed
If we have Xcode installed, we can skip the install and force the terminal to use Xcode’s Command-line tools.
sudo xcode-select --reset sudo xcodebuild -license
More CLI Articles
- How to Update Node to Another Version on Windows WSL
- How to Use SSH with GitHub (Instead of HTTPS) on Windows WSL
- How to Delete Files with a Specific Extension in all Subdirectories Recursively
- How to Suppress Output of npm install
- How to Pass Environment Variables to Makefiles in Subdirectories
- How to Access Environment Variables in a Makefile
- How to Reset Password on Ubuntu Linux
- How to Pull a Branch from Another User's Fork using Git
- How to Align GitHub README images in Markdown
- How to Merge Development and Production Branches in Git
- How to Quickly Push to Git with a Bash Script
- How to Change Author of Commit in Git History
- WSL2: How to Fix "Virtual hard disk files must be uncompressed and unencrypted and must not be sparse"
- How to Replace a Branch with Another Branch in Git
- How to Delete a Git Branch Locally and Remotely
- How to Schedule Recurring Deploys in Netlify
- How to View All Global Packages in npm
- How to Test an npm package locally
- How to Update an npm Package (Fixing "You cannot publish over the previously published versions")
- How to Undo Changes in a Single File in Git
- How to Fix the Netlify error: "Treating warnings as errors because process.env.CI = true"
- How to Set the Default Directory for Git Bash on Windows
- How to Search Past Terminal Commands in Linux
- How to Get the Count of Files with each File Extension in Linux
- How to Find All Files with a Specific File Extension in Linux
- How to Run Multiple Commands Simultaneously in Linux
- How to Watch a File in Linux using tail
- Linux Timestamps: The Difference Between atime, mtime, ctime, and crtime
- How To Remove Duplicate Lines While Maintaining Order in Linux
- How To Count the Number of Non-Empty Output Lines in Linux
- How To Find All IP Addresses within a File in Linux with grep
- How To Rename Every File in all Subdirectories in Windows CMD