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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangbingfengf98/article/details/83411429

A: After upgrading to macOS Sierra (and later 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.

How do I fix it?

Q: 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

我使用的是 xcode-select --install解决问题,后面的命令使用结合自己的环境来使用。

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

猜你喜欢

转载自blog.csdn.net/wangbingfengf98/article/details/83411429