mac下安装brew、node

最近新配了一台电脑,总结一下。
一、安装brew
1、安装brew

$ curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1

2、安装完成后执行
$ brew

提示Please run brew update!
3、按照提示更新,执行
$ brew update

报错:Error: /usr/local must be writable!
4、赋给/usr/local目录权限,执行
$ sudo chown -R $(whoami) /usr/local

5、再次执行
$ brew update

提示:
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0HEAD is now at c3f959d Merge pull request #1542 from woodruffw/deprecate-utils-jsonTo restore the stashed changes to /usr/local run:'cd /usr/local && Git stash pop'==> Homebrew has enabled anonymous aggregate user behaviour analyticsRead the analytics documentation (and how to opt-out) here:https://git.io/brew-analytics==> Tapping homebrew/coreCloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...remote: Counting objects: 3757, done.remote: Compressing objects: 100% (3647/3647), done.remote: Total 3757 (delta 13), reused 305 (delta 1), pack-reused 0Receiving objects: 100% (3757/3757), 3.00 MiB | 30.00 KiB/s, done.Resolving deltas: 100% (13/13), done.Checking connectivity... done.Tapped 3636 formulae (3,784 files, 9.3M)Already up-to-date.Error: Could not link:/usr/local/share/doc/homebrewPlease delete these paths and run `brew update`.==> Migrating HOMEBREW_REPOSITORY (please wait)...Error: Could not link:/usr/local/share/doc/homebrewPlease delete these paths and run `brew update`.==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!Homebrew no longer needs to have ownership of /usr/local. If you wish you canreturn /usr/local to its default ownership with:sudo chown root:wheel /usr/local

6、按照提示删除/usr/local/share/doc/homebrew,执行
$ rm -r -f /usr/local/share/doc/homebrew

7、再次执行
$ brew update

安装成功。
二、安装node
$ brew install node

【mac下安装brew、node】node自带npm,有了npm,就很happy了,make youself happy。

    推荐阅读