brew install yarn --without-node
再也不起做用,yarn 已经删除了 option --without-node
。node
homebrew 已安装。
(非必需条件)使用 zsh 替换 bash:git
chsh -s /bin/zsh
安装 nvm:github
~/.bash_profile
是否存在,若是没有则新建一个;执行 touch ~/.bash_profile
;执行安装命令:shell
// cURL: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash // or Wget: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
安装 node:npm
// 安装最新 node nvm install node --latest-npm // Always default to the latest available node version on a shell nvm alias default node
检查 node:bash
node -v
显示 node 版本,例如 v12.1.0
curl
安装 yarn:url
安装 yarn 时不安装 node:code
brew install yarn --ignore-dependencies
查找 node:orm
which node
显示 node 的安装位置,例如:/Users/<your's-user-name>/.nvm/versions/node/v12.1.0/bin/node
执行 brew doctor
检查依赖,会出现:
Warning: Some installed formulae are missing dependencies. You should `brew install` the missing dependencies: brew install node Run `brew missing` for more details.
为 homebrew 建立 node 的 symbol link:
ln -s ~/.nvm/versions/ /usr/local/Cellar/node
brew doctor
进行检查,Warning 信息消失。