Error: Running Homebrew as root is extremely dangerous and no longer supported.As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
$ brew install yarn，然后出现如下提示：
Error: The following directories are not writable by your user:
You should change the ownership of these directories to your user.
$ sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
And make sure that your user has write permission.
$ chmod u+w /usr/local/share/man/man5 /usr/local/share/man/man7