macOS Mojave: invalid active developer path after updating to Mojave from High Sierra

戏子无情 提交于 2019-12-20 12:39:05

问题


After upgrading to macOS Mojave, I tried to run GIT from Terminal but it kept giving me the following error:

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

Previously it was working fine.


回答1:


Open Terminal, and run the following:

xcode-select --install

This will download and install xcode developer tools and fix the problem. The problem is that one needs to explicitly agree to the license agreement. As a follow on step, you may need to reset the path to Xcode if you have several versions or want the command line tools to run without Xcode.

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

xcode-select --switch /Library/Developer/CommandLineTools

I have also found the solution in this question.

https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path




回答2:


This line worked for me. I had the same issue. Run it in the terminal.

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



回答3:


when I use git in the terminal:

then I run it:

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


来源:https://stackoverflow.com/questions/52753865/macos-mojave-invalid-active-developer-path-after-updating-to-mojave-from-high-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!