When I checked Homebrew for problems with the brew doctor command, problems overflowed, so I solved them one by one.
macOS Catalina version 10.15.4 Xcode version 11.4
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
#First error
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
#Second error
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
node
#Third error
Warning: Your Xcode (11.4) is outdated.
Please update to Xcode 11.4.1 (or delete it).
Xcode can be updated from the App Store.
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
→ $ softwareupdate --all --install --force
You are instructed to execute the command, so execute it.
$ softwareupdate --all --install --force
→ If this does not solve the problem, install the latest version at App Developer.
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
node
→ This also says that you should execute $ brew link
to
node```, so execute the command according to the instructions.
$ brew link node
Error: Could not symlink share/doc/node/gdbinit
Target /usr/local/share/doc/node/gdbinit
already exists. You may want to remove it:
rm '/usr/local/share/doc/node/gdbinit'
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
→ However, I got the above error.
→ I was instructed to delete or forcibly overwrite the target file because I can't create a symlink in the share / doc / node / gdbinit
file. (For those who are wondering what a symbolic link is, this article will be very helpful.)
→ Then, execute the $ brew link --overwrite node
command as instructed.
$ brew link --overwrite node
Error: Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.
→ And error again. The `` `/ usr / local / share / doc / nodedirectory is said to be
is not writable```, that is, you do not have write permission, so give the user permission to write to this directory. Delegate to the current account.
→ To make it writable, execute the command as follows.
$ cd /usr/local/share/doc
$ sudo chown -R $USER node
Password:
→ First, move to the doc directory` `` where the node directory is located. → By delegating user authority to the current account with the
chown command``, you are given write permission to the directory (for the chown command, see this article](https://webkaru.net). / linux / chown-command /) will be helpful). → If you are prompted to enter the password as described above, enter the password you set when you logged in to your PC. → Now that it is writable, execute the ``
$ brew link``` command again.
$ brew link --overwrite node
Linking /usr/local/Cellar/node/14.2.0...
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
→ However, this time I got an error saying that I do not have write permission for another file.
→ I want to make this also writable, so give write permission in the same way as the previous procedure.
$ cd /usr/local/share/systemtap
$ sudo chown -R $USER tapset
→ Move to the `systemtap directory`
where the tapset directory is located.
→ Use the chown command`
to delegate user privileges to the current account and enable writing.
→ Then execute the $ brew link
command.
$ brew link --overwrite node
Linking /usr/local/Cellar/node/14.2.0...
Error: Could not symlink lib/dtrace/node.d
/usr/local/lib/dtrace is not writable.
→ Again, like the above two errors, I got an error saying that I do not have write permission.
→ Similarly, give write permission to the directory.
$ cd /usr/local/lib
$ sudo chown -R $USER dtrace
→ Move to the lib directory` `` where the distrace directory is located. → Transfer user privileges to the current account with the
chown command` . → Then execute the
$ brew link``` command.
$ brew link --overwrite node
Linking /usr/local/Cellar/node/14.2.0... 7 symlinks created
→ It seems that the link was successfully established this time (good ...).
__ * When executing the chown command, the error "Operation not permitted" may appear. If this happens, please refer to the following. __ (I faced this situation)
__ This can be solved by changing the terminal environment settings themselves, so I will explain the procedure. __
Warning: Your Xcode (11.4) is outdated.
Please update to Xcode 11.4.1 (or delete it).
Xcode can be updated from the App Store.
→ Follow the instructions to update Xcode to 11.4.1. → Download and install Xcode 11.4.1 from App Developer. → Move the installed Xcode file under the Applications directory. → __ If the above doesn't fix the Xcode update error, try the following methods. __
I think that the error correction is completed, so let's check it with the $ brew doctor command.
$ brew doctor
Your system is ready to brew.
→ It went well!
https://wtnvenga.hatenablog.com/entry/2017/11/15/125430 → It was very helpful for errors related to symlink.
https://gori.me/mac/mac-tips/112082 → It was helpful in the terminal settings.