Mac上 homebrew+node+npm+yarn 安装和踩坑过程
一、第一步:安装homebrew
注:安装homebre的目的主要是为了安装node
终端执行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
参考官网:https://brew.sh/
报错误1:
=> xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
解决办法:
sudo xcode-select --reset
其实出现这个原因是我之前用镜像安装,未按官网推荐安装时出现了如下错误2:
Error: Your Xcode (9.0) is outdated. Please update to Xcode 9.0 (or delete it). Xcode can be updated from the App Store.
按照网上方法无法彻底删除系统自带的Xcode (9.0),所以就去下载安装了个10.0版本,同时把brew环境指向现在的Xcode,执行:
sudo xcode-select -switc