前提条件:
homebrew已安装

  • brew upgrade node

  • usr/local/Cellar/node/7.2.1/bin/node

  • usr/local/Cellar/node/7.2.1/libexec/npm/bin/npm

  • cd 到 usr/local/bin ,执行 ln -s usr/local/Cellar/node/7.2.1/bin/node node

  • 执行 ln -s usr/local/Cellar/node/7.2.1/libexec/npm/bin/npm npm

  • node -v

  • npm -v

  • 搞定