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 信息消失。