Homebrew npm install: could not symlink


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

brew doctor

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s