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