mac下安装git或者npm install 时遇到xcode-select 识别xcode路径的问题

在mac下使用git或者npm install 时经常遇到下面的问题:

xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
 

但是mac下又没有安装xcode。此时可以按照下面的步骤,就可以不用安装xcode就能解决这个问题:

1.xcode-select --install 

2.sudo xcode-select --switch /Library/Developer/CommandLineTools

猜你喜欢

转载自blog.csdn.net/qq_20567691/article/details/85987190