No available formula or cask with the name "git"
使用 brew config
检查brew的配置项
我的配置项中core tap有配置项缺失,所以brew无法找到包
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: (none)
Core tap last commit: never
Core tap branch: HEAD
20210506131629.jpg
执行以下命令,删除原有的homebrew-core文件夹,重新创建
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
brew tap homebrew/core
修复core tap的配置项后:
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 78dbff03e5f3a0c9f4a341788e563f060064540e
Core tap last commit: 4 minutes ago
Core tap branch: master
20210506131403.jpg
此时重新 brew install git
成功啦 👏🏻
出自里边有位叫 carlocab 的同学的解答 https://github.com/Homebrew/discussions/discussions/580
一开始还遇到有mac使用brew的权限问题,根据命令行的提示用sudo给予一定的配置后就可以使用brew了
网友评论