mac 安装brew

eact native搭建环境,安装homebrew的时候,在终端输入

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

提示:

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


解决方法:

这个是stackoverflow的解决方法,英文的,我翻译了一下

我的翻译:

先在浏览器输入这个地址:

https://raw.githubusercontent.com/Homebrew/install/master/install


看是否能打开,不能打开就是你网络有问题,不要问我哦。

能打开如下:

把这个网页保存名为brew_install.rb的文件,保存的位置你随便,只要自己能找到。

则在终端输入curl

$ curl

curl: try 'curl --help' or 'curl --manual' for more information

这样就没错,要是报错,那我就不知道了!

然后在终端进入存放这个文件的目录(这个不用我教吧),然后终端输入

ruby brew_install.rb

然后等安装homebrew吧!

-------------开始长时间安装brew------

碰到报错:

报错
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.

解决:
// 执行下面这句命令,更换为中科院的镜像:
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

// 把homebrew-core的镜像地址也设为中科院的国内镜像

cd "$(brew --repo)"

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

// 更新
brew update

// 使用
brew install node

原文地址:https://www.cnblogs.com/zhanghengscnc/p/12194560.html