LoginSignup
137
32

More than 3 years have passed since last update.

gitコマンドを実行したら「xcrun: error: invalid active developer path」というエラーが出た時の対処法

Posted at

はじめに

gitコマンドを実行しようとしたらエラーが発生したので、その解決方法をメモとして残しておきます。

エラー内容

git init で以下のエラーが発生しました。

エラー内容
% git init
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

対処

xcode-selectコマンドでコマンドライン開発者ツールをインストールします。

インストール
% xcode-select --install
xcode-select: note: install requested for command line developer tools

するとポップアップが表示されるので流れに沿って進んでいきます。




初めは2時間以上の表示が出ましたが、なんだかんだ5分くらいでインストール完了しました。
それでは再度実行します。

再実行
% git init
Initialized empty Git repository in /Users/work/.git/

無事実行できました。

おわりに

macOSのバージョンアップを行なったりするとこのような事象が発生するようです。

137
32
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
137
32