MAC Homebrew

  • Homebrew安装
  • 查看版本
  • Thirft安装
  • node.js安装
  • http-server 安装

Homebrew安装


.
$  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
.
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
==> The following existing directories will have their owner set to jintian:
/usr/local/bin
==> The following existing directories will have their group set to admin:
/usr/local/bin
==> The following new directories will be created:
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin
==> /usr/bin/sudo /usr/sbin/chown jintian /usr/local/bin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin
==> /usr/bin/sudo /bin/mkdir -p /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown jintian /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/jintian/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/jintian/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown jintian /Users/jintian/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (macOS Mojave version 10.14) for Xcode-10.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ Mojave\ version\ 10.14)\ for\ Xcode-10.3
Software Update Tool


Downloading Command Line Tools (macOS Mojave version 10.14) for Xcode
Downloaded Command Line Tools (macOS Mojave version 10.14) for Xcode
Installing Command Line Tools (macOS Mojave version 10.14) for Xcode
Done with Command Line Tools (macOS Mojave version 10.14) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Enumerating objects: 68, done.
remote: Counting objects: 100% (68/68), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 125909 (delta 28), reused 36 (delta 13), pack-reused 125841
Receiving objects: 100% (125909/125909), 29.90 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (92276/92276), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]         0.1        -> 0.1
 * [new tag]         0.2        -> 0.2
 * [new tag]         0.3        -> 0.3
 ... ...
 * [new tag]         2.1.4      -> 2.1.4
 * [new tag]         2.1.5      -> 2.1.5
 * [new tag]         2.1.6      -> 2.1.6
 * [new tag]         2.1.7      -> 2.1.7
 * [new tag]         2.1.8      -> 2.1.8
 * [new tag]         2.1.9      -> 2.1.9
HEAD is now at 4a3442d1a Merge pull request #6432 from GauthamGoli/argv-cleanup-2
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 5025, done.
remote: Counting objects: 100% (5025/5025), done.
remote: Compressing objects: 100% (4826/4826), done.
remote: Total 5025 (delta 48), reused 576 (delta 9), pack-reused 0
Receiving objects: 100% (5025/5025), 4.01 MiB | 54.00 KiB/s, done.
Resolving deltas: 100% (48/48), done.
Tapped 2 commands and 4814 formulae (5,067 files, 12.5MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh

报错

SSL_ERROR_SYSCALL in connection to XX
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
解决方案
把ipv6禁用,“系统偏好设置”->"网络"->选择对应的网卡->"高级"->"配置ipv6",选择适合自己的选项,本人选择的是仅本地连接。记得点击"应用"

error: Not a valid ref: refs/remotes/origin/master

fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git  [...] -- [...]'
fatal: Could not resolve HEAD to a revision

fatal: unable to access 'https://github.com/Homebrew/brew/'

 * [new tag]             3.2.9                  -> 3.2.9
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
Failed during: git fetch --force --tags origin
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
Failed during: git fetch --force origin

使用国内源/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

Homebrew国内源

image.png

image.png
% brew -v
Homebrew 3.2.17-110-g6de841c
Homebrew/homebrew-core (git revision 524fedbdcf2; last commit 2021-10-22)
Homebrew/homebrew-cask (git revision 053c9efb42; last commit 2021-10-22)

查看版本


$ brew --version
Homebrew 2.1.11
Homebrew/homebrew-core (git revision e234; last commit 2019-09-10)
JinTiandeMac-mini:swagger-ui-master jintian$ 

git-lfs安装

$ brew install git-lfs
$ git lfs install

$ git lfs clone https://github.com/volcengine/TTSDK-iOS.git

Thirft安装


$ brew install thrift
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
armadillo          dnscrypt-proxy     gtranslator        libvmaf            step
buildifier         gedit              ipv6calc           netdata            template-glib
cppcheck           glooctl            jsonrpc-glib       php-cs-fixer       terragrunt
dita-ot            golang-migrate     libdazzle          pygobject3         vte3

==> Installing dependencies for thrift: icu4c, boost and [email protected]
==> Installing thrift dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-64.2.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e8/e858556120acc0c2d52b8fb572b677856724cc28d24a
######################################################################## 100.0%
==> Pouring icu4c-64.2.mojave.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> Summary
  /usr/local/Cellar/icu4c/64.2: 257 files, 69.2MB
==> Installing thrift dependency: boost
==> Downloading https://homebrew.bintray.com/bottles/boost-1.71.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/56/56088325bde433fa3c28e6f4d635d478b912e1b08e8e
######################################################################## 100.0%
==> Pouring boost-1.71.0.mojave.bottle.tar.gz
  /usr/local/Cellar/boost/1.71.0: 14,377 files, 522.8MB
==> Installing thrift dependency: [email protected]
==> Downloading https://homebrew.bintray.com/bottles/[email protected]
==> Downloading from https://akamai.bintray.com/e4/e4c85922978ded43321679e00ecb35b47d3924e60420
######################################################################## 100.0%
==> Pouring [email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/[email protected]/certs

and run
  /usr/local/opt/[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

==> Summary
  /usr/local/Cellar/[email protected]/1.1.1c: 7,963 files, 17.9MB
==> Installing thrift
==> Downloading https://homebrew.bintray.com/bottles/thrift-0.12.0_1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/ea/ead278adf991ed6056b97806f5a7815f76340492d00b
######################################################################## 100.0%
==> Pouring thrift-0.12.0_1.mojave.bottle.tar.gz
  /usr/local/Cellar/thrift/0.12.0_1: 106 files, 7MB
==> Caveats
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

==> [email protected]
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/[email protected]/certs

and run
  /usr/local/opt/[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"



node.js安装


$ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-12.10.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e2/e230187b694d98b4419de13f66b56a13d0330226b612
######################################################################## 100.0%
==> Pouring node-12.10.0.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
  /usr/local/Cellar/node/12.10.0: 4,590 files, 53.4MB
$ node -v
v12.10.0
$ npm -v
6.11.3

http-server 安装


$  npm install -g http-server 
/usr/local/bin/http-server -> /usr/local/lib/node_modules/http-server/bin/http-server
/usr/local/bin/hs -> /usr/local/lib/node_modules/http-server/bin/http-server
+ [email protected]
added 26 packages from 28 contributors in 5.015s

你可能感兴趣的:(MAC Homebrew)