I was trying to upgrade NodeJS on my Mac and I was shown the following error.
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.
Here’s what I did to fix this issue:
Type in the following command in your terminal.
sudo chown -R (your_mac_username_here) /usr/local/share/doc/node
Then I ran
and followed any further instructions it mentioned pertaining to node. In my case I had to run the commands.
brew link –overwrite node
brew upgrade node
You may not have to run these commands exactly. When you type brew doctor, it will give you further instructions on what you need to do. Hope this helps anyone if they’re having this issue!