Command Line Tools not working - OS X El Capitan,

2019-01-02 16:50发布

I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example git status inside a terminal, I get the following error:

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

I don't have Xcode installed, never did. Anyone have a solution?

14条回答
只靠听说
2楼-- · 2019-01-02 17:16

I upgraded mac os to macOS High Sierra - 10.13.3 and faced a similar issue while trying to install watchman (with command - brew install watchman).

ran the command: xcode-select --install, then ran "brew install watchman" - Everything works fine!

查看更多
听够珍惜
3楼-- · 2019-01-02 17:16

For me, after I've removed Xcode, I have to switch active developer path as follows: sudo xcode-select -s /

查看更多
浪荡孟婆
4楼-- · 2019-01-02 17:20

In macOS 10.14 this issue may also occur if you have two or more versions installed. If you like xCode GUI you can do it by going into preferences - CMD + ,, selecting Locations tab and choosing version of Command Line Tools. Please refer to the attached print screen.

enter image description here

查看更多
长期被迫恋爱
5楼-- · 2019-01-02 17:21

For Mojave

Uninstall Any old version of Command Line Tools:

sudo rm -rf /Library/Developer/CommandLineTools

Download and Install Command Line Tools 10.14 Mojave.

查看更多
公子世无双
6楼-- · 2019-01-02 17:24

I tried the solution xcode-select --install but it don't help me, I update from Sierra to High and happened this, my solution:

sudo xcode-select --reset
查看更多
只靠听说
7楼-- · 2019-01-02 17:29

I just updated to High Sierra and I couldn't just run xcode-select --install. First, I had to actually install xcode from the app store. Then I ran xcode-select --install. Then I had to run sudo xcodebuild -license, agree to the terms, then I could finally run git commands again.

查看更多
登录 后发表回答