1、brew:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
brew -v 查看版本
示例: 安装jdk
brew search jdk
查询可用的jdk版本
brew install openjdk@11
安装制定版本jdk
更换源:例如清华源
# 替换默认源:
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换bottles源:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 更新Brew:
$ brew update
2、nvm
brew install nvm
查询是否已经安装: nvm --version
错误: zsh: command not found: nvm文章来源:https://www.toymoban.com/news/detail-603411.html
解决:文章来源地址https://www.toymoban.com/news/detail-603411.html
目录: mkdir ~/.nvm
配置文件: ~/。bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
复制: . "/usr/local/opt/nvm/nvm.sh" 将nvm.sh复制到可执行目录下
执行: source ~/。bash_profile
到了这里,关于macOS 下安装brew、nvm的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!