Mac 安装homebrew

2020-01-02  本文已影响0人  JQWONG

Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。

安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

但是个人觉得可能是国内网络的问题经常下载并不是很顺利,经常443拒绝访问

如何解决

ruby brew_install.rb

如何使用

brew install <packageName>
brew install react-native-cli
brew uninstall <packageName>
brew search <packageName>
brew list
brew update
brew -h
brew install git // 使用brew安装软件
brew home   // 用浏览器打开brew的官方网站
brew info   // 显示软件信息
brew deps   // 显示包依赖

brew和brew cask区别

MacBook Pro M1芯片问题

安装成功后会出现command not found: brew字样,无法使用

==> /usr/bin/sudo /usr/sbin/chown joeliu:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at 4a90a5a5d Merge pull request #10199 from reitermarkus/check-https-content
Already up-to-date.
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
~ % brew help
zsh: command not found: brew

在终端输入即可解决问题

// 二选一
export PATH="/opt/homebrew/bin:$PATH"
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> $HOME/.zshrc

参考文章
Mac必备神器Homebrew
M1 command not found: brew
上一篇下一篇

猜你喜欢

热点阅读