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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM