Homebrew -- 安装与使用
使用 React Native,必须安装的依赖有:Node、Watchman 和 React Native 命令行工具以及 Xcode。
推荐使用Homebrew来安装 Node 和 Watchman。
1、Homebrew是什么?
Homebrew是以最简单,最灵活的方式来安装苹果公司在MacOS中不包含的UNIX工具。 换句话说就是macOS 缺失的软件包的管理器。
官方网站:点击查看
Git仓库地址:点击查看
2、Homebrew 安装:
打开mac终端,复制粘贴下面命令,根据要求,一步一步即可。
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3、Homebrew卸载:
打开mac终端,复制粘贴下面命令(其实只用把上面安装的install换成uninstall就行了)。
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
4、Homebrew 怎么使用?常用命令有哪些?
安装软件,如:brew install oclint
卸载软件,如:brew uninstall oclint
搜索软件,如:brew search oclint
更新软件,如:brew upgrade oclint
查看安装列表, 如:brew list
更新Homebrew,如:brew update
5、安装中遇到的问题
(1)错误描述如下:
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
原因:xcode的命令行工具不再安装在/Library/Developer/CommandLineTools 这个位置了,而是如下图所示的位置:
/Applications/Xcode.app

这个时候只需要使用下面这个命令设置一下就可以了:
sudo xcode-select --switch /Applications/Xcode.app
最后再输入下面命令验证一下:
xcode-select -p
打印输出
/Applications/Xcode.app/Contents/Developer
然后再尝试安装命令,就没有出现上面的那个问题了。
想法:个人觉得上面的那个问题可以不用管,因为xcode 已经自动安装了CommandLineTools这个工具。
6、详细的流程:
$ sudo xcode-select --switch /Applications/Xcode.app
Password:
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
$ /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 Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
==> 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 High Sierra version 10.13) for Xcode-9.4
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ High\ Sierra\ version\ 10.13)\ for\ Xcode-9.4
Software Update Tool
Downloading Command Line Tools (macOS High Sierra version 10.13) for Xcode
Downloaded Command Line Tools (macOS High Sierra version 10.13) for Xcode
Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done with Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
HEAD is now at dae47914 Merge pull request #4992 from MikeMcQuaid/keg-remove-top-level-directories
==> Migrating /Library/Caches/Homebrew to /Users/galahad/Library/Caches/Homebrew
==> Deleting /Library/Caches/Homebrew...
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.html
==> 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
接下来可以使用Homebrew来安装 Node 和 Watchman等工具了。
Homebrew -- 安装与使用的更多相关文章
- OS X 下不通过Homebrew安装ASP.NET 5开发环境
在 ASP.NET 的 Home repo 里,推荐使用 Homebrew 安装开发环境,不过我的电脑里已经有 ports 了,这应该是当年用 rvm 安装 Ruby 时悄悄地装上的吧.不管怎样,作为 ...
- Homebrew安装及使用
简介 Homebrew官网:http://brew.sh/index_zh-cn.html Homebrew是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件,相当于linux ...
- Mac OSX 下用 Homebrew 安装 MongoDB 并配置到 WebStorm 中
1. 安装 Ruby OSX 操作系统内置 Ruby,但如果没有 Ruby,则需先输入以下命令安装能够进行多版本ruby环境安装.管理和切换的命令行工具 RVM. 1.1 安装 RVM 打开终端输入以 ...
- mac下 home-brew安装及php,nginx环境安装及配置
Homebrew官网 http://brew.sh/index_zh-cn.html Homebrew是神马 linux系统有个让人蛋疼的通病,软件包依赖,好在当前主流的两大发行版本都自带了解决方案, ...
- 解决Mac下Sequel Pro 1.1 连接 Homebrew安装Mysql5.7.8的问题 Sequel Pro 1.1 encountered an unexpected error
解决Mac下Sequel Pro 1.1 连接 Homebrew安装Mysql5.7.8的问题 Sequel Pro encountered an unexpected error Sequel Pr ...
- Mac OS X 程序员利器 – Homebrew安装与使用
Mac OS X 程序员利器 – Homebrew安装与使用 Homebrew安装与使用 什么是Homebrew? Homebrew is the easiest and most flexible ...
- 在mac上利用homebrew安装软件
在mac经常需要安装一些软件,你可以通过app store下载,或者可以通过浏览袭搜索下载.这里介绍通过homebrew安装一些软件,它会自动为你下载一些软件的相关依赖,免去安装的烦恼. 首先我们需要 ...
- Mac OS X下HomeBrew安装卸载
1.卸载 cd `brew --prefix` rm -rf Cellar brew prune rm `git ls-files` rm -r Library/Homebrew Library/Al ...
- Mac OS X用户,使用homebrew安装,FreeBSD也可以
qtkeychain 这是编译和运行软件必须的库.各平台都可以编译安装.对于Mac OS X用户,使用homebrew安装: brew install qt5keychain (旧版本的Mac OS ...
- HomeBrew 安装 PHP7.1(开发笔记)
HomeBrew 安装 PHP7.1 $ brew update $ brew tap homebrew/dupes $ brew tap homebrew/php $ brew update $ b ...
随机推荐
- [转]托管DirectX,从MDX到SlimDX的转换
开始迁移到托管DirectX SlimDX框架的,例如,MDX应用的帕特里克Murrisa地形的浏览器. 在托管DirectX代码所示,到新的代码,与SlimDX评论的形式. MDX迁移项目中Slim ...
- $NOIp$前的日常
嗯,一想到没准今年\(NOIp\)之后就要退役了,觉得没准这篇博客就是我OI史上的绝唱了-- \(hhh\),希望不会这样. \(12.4\) 退役了是真的233-- 居然感到一身轻松啊qwqwq \ ...
- 升序排列的数组中是否存在A[i]=i
#include<stdio.h> void equal(int a[],int N) { int i; ;i<N;i++) { if(i<a[i]) { printf(&qu ...
- C++标准转换运算符dynamic_cast
dynamic_cast <new_type> (expression) dynamic_cast运算符,应该算是四个里面最特殊的一个,因为它涉及到编译器的属性设置,而且牵扯到的面向对象的 ...
- Linux的信号解释
转自:http://blog.csdn.net/yusiguyuan/article/details/43272225 整理后: 信号signal unix系统中,用信号实现软件中断 子进程结束-&g ...
- 《Arduino 机器人制作指南》唐乐 分享 pdf下载
链接:https://pan.baidu.com/s/1cF7gaQoJXwfY0asnsimFrQ提取码:stq1
- lua协程实现
协程是个很好的东西,它能做的事情与线程相似,区别在于:协程是使用者可控的,有API给使用者来暂停和继续执行,而线程由操作系统内核控制:另外,协程也更加轻量级.这样,在遇到某些可能阻塞的操作时,可以使用 ...
- http://browniefed.com/blog/2015/09/10/the-shapes-of-react-native/
http://browniefed.com/blog/2015/09/10/the-shapes-of-react-native/
- UWP 设置桌面壁纸、锁屏图片
private static Uri imgUri = new Uri("ms-appx:///pic1.jpg"); private async void btnSetWallp ...
- 【转载】C++创建对象的两种方法
原文:http://blog.sina.com.cn/s/blog_586b6c050100dhjg.html 在C++里,有两种方法创建对象: 方法一: ClassName object(param ...