Mac 報錯 xcrun: error
更新 Mac 之後提交 git 報錯:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
自問
- 是否已從 App Store 升級到 OS X El Capitan ?
- 是否突然開始在項目中收到以上錯誤?
如果是那麼解決方案就很簡單了,只需要執行:
xcode-select --install
[外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-oD78XlFx-1581507212922)(./zhuang.jpg)]
安裝成功就可以。
git 是否有問題
查看 git 是否安裝成功
which git
如果沒有安裝,只需要裝好久可以了
brew install git
Xcode報錯
報錯:
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/houyaohui/wwwroot/QYer/fe-ask/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
更新不管用,直接刪掉從新再下載一次
1、
sudo rm -rf $(xcode-select -print-path)
2、
xcode-select --install