當(dāng)我們重新安裝mac的系統(tǒng)后,就需要對(duì)mac進(jìn)行以下工具的安裝
1、xcode
打開終端,執(zhí)行以下命令
xcode-select --install
顯示以下信息,代表xcode還未安裝成功,這時(shí)會(huì)有安裝提示,傻瓜式安裝即可~~~
xcode-select: note: install requested for command line developer tools
顯示以下信息,代表xcode安裝成功
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
2、HomeBrew 官網(wǎng)
打開終端,執(zhí)行以下命令
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
由于網(wǎng)絡(luò)原因,安裝會(huì)比較慢,可能會(huì)出現(xiàn)以下錯(cuò)誤信息
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
若出現(xiàn)以上信息,可以嘗試增大緩沖配置,執(zhí)行以下命令,然后重裝,多試幾次,
git config --global http.postBuffer 524288000
重新安裝如果報(bào)以下錯(cuò)誤,說(shuō)明Homebrew安裝成功,但Homebrew/homebrew-core未安裝成功

homebrew-core-error.jpeg
終端執(zhí)行
brew --version
出現(xiàn)
Homebrew 2.4.7
Homebrew/homebrew-core N/A
執(zhí)行
brew update
會(huì)出現(xiàn)以下報(bào)錯(cuò),可以多試幾次,也可以更換鏡像源
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
3、yarn
打開終端,執(zhí)行以下命令
brew install yarn
檢查yarn是否安裝成功
yarn --version
4、node
打開終端,執(zhí)行以下命令
brew install node
也可以直接下載node安裝包 下載地址
檢查node是否安裝成功
node --version
npm --version
5、git
mac自帶
打開終端,執(zhí)行以下命令
brew install git
也可以直接下載git安裝包 下載地址
檢查git是否安裝成功
git --version
6、ssh key
打開終端,進(jìn)入根目錄
ls -a
touch .ssh
ssh-keygen -t rsa -C 'xxx@email.com'
cd .ssh
cat id_rsa.pub
復(fù)制公鑰內(nèi)容,在git倉(cāng)庫(kù)配置,即可下載ssh協(xié)議的git地址,之后就可以進(jìn)行pull,push等操作。