现象:
yuwentekiMacBook-Pro:~ yuwen$ brew install node
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/mysql/bin in PATH, mode 040777
==> Downloading https://homebrew.bintray.com/bottles/node-7.10.0.sierra.bottle.tar
Already downloaded: /Users/yuwen/Library/Caches/Homebrew/node-7.10.0.sierra.bottle.tar.gz
==> Pouring node-7.10.0.sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
brew link --overwrite node
To list all files that would be deleted:
brew link --overwrite --dry-run node
Possible conflicting files are:
/usr/local/bin/node
/usr/local/share/man/man1/node.1
/usr/local/lib/dtrace/node.d
==> Using the sandbox
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
/usr/local/Cellar/node/7.10.0: 3,078 files, 39.7MB
yuwentekiMacBook-Pro:~ yuwen$ node --version
v0.10.22
解决:
1、brew uninstall node
2、删除链接文件
rm '/usr/local/bin/node'
rm '/usr/local/share/man/man1/node.1'
rm '/usr/local/lib/dtrace/node.d'
3、brew install node