1.设置相关操作
2.访达新建相关文件夹
3.此事电脑还没有git,下载xcode,里面包含相关依赖和环境
4.命令窗口安装Oh My Zsh 操作步骤
5.安装nvm
执行下面操作
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
安装说明:电脑没有安装node,如果安装需要卸载。如果安装失败,多执行几次。
nvm安装成功开始安装需要的node
nvm install v12.2.0
nvm install v16.13.0
切换node版本
nvm use 12
nvm use 16
6.Mac 通过终端CD命令快速定位到指定文件夹
a、打开终端
b、输入cd
c、将想要到达的文件夹拖进终端,点击回车,就到了指定的文件夹了
7.MAC 生成SSH Key
a,创建公钥,打开终端输入命令行
ssh-keygen -t rsa -C "xxx@xxx.com"
b.之后会让你输入保存路径,密码之类的 直接一路Enter,如下图,会自动给个默认路径
c.之后打开公钥
cat ~/.ssh/id_rsa.pub
会得到如下图的一段编码
d.然后将上图编码放进网站添加公钥的地方即可
8.下载brew
命令终端输入:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew在本地保存了很多常用软件的地址
可以通过
brew search 软件名(qq)查询软件
通过
brew install 软件名安装
为了防止某些软件下载失败,可以配置镜像地址:
前提:电脑已经下载了git xcode
接着,在终端输入以下几行命令设置环境变量:
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
替换现有仓库上游
终端执行命令:
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
brew update
最后终端执行:
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
brew tap --custom-remote --force-auto-update homebrew/cask-drivers https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew update
至此大功告成!你可以愉快地通过brew命令安装软件了,安装方法类似npm命令