1. Perform

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
Copy the code

An error

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

The error is probably your computer was refused to go to raw.githubusercontent.com

Here’s how I solved it

2. Open the web site: [https://www.ipaddress.com/] (https://www.ipaddress.com/) to check the IP address of the corresponding raw.githubusercontent.com

Then write the corresponding IP address to your hosts file

If you are having trouble editing the hosts file again, follow these steps.

3. Run sudo vi /etc/hosts and enter the password to open the hosts file

Press I (insert) and esc(Exit) after editing

Press ‘Shift’ + ‘:’ again

Enter wq(save and exit)

At this point, you have modified the hosts file

4. Enter information on the terminal

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code

Press return to continue the installation. Do not press any other key. This will terminate the installation.

The installation is not complete until you see that the installation is successful.

The problem arises again. I haven’t seen successful**** ha **, but I have been incorrectly reported on tapping

There is no way to only use the mirror, and the official website provided ali mirror according to the steps or encountered problems

An error was reported when executing the above code

cd: no such file or directory: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
Copy the code

5. Continue to resolve the error

1) Go to the TAPS folder and create a Homebrew file

cd /usr/local/Homebrew/Library/Taps

mkdir homebrew

cd homebrew

Execute the command

git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
Copy the code

2) Replace homebrew sources

Replace the homebrew default source

cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
Copy the code

Replace homebreW-core default source

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
Copy the code

Application effect

brew update
Copy the code

The brewhome installation is complete!!

I prefer VPN to install react-Native