can't brew install node can't brew install node node.js node.js

can't brew install node


There are two steps involved.

  1. Simply run these four commands:
    sudo chown -R `whoami`:admin /usr/local/include/node    sudo chown -R `whoami`:admin /usr/local/bin    sudo chown -R `whoami`:admin /usr/local/share    sudo chown -R `whoami`:admin /usr/local/lib/dtrace 
  1. Finally, run the overwrite command:
    brew link --overwrite node


I ran into this same issue under the same circumstances. I was able to get the brew version to install successfully by:

  1. Run brew install node
  2. Make note of the module that is causing the issue and delete it. In your case, this would be /usr/local/include/node
  3. Uninstall - brew uninstall node
  4. Re-install - brew install node

I had to repeat this process a few times for each remaining problematic directory (about 3 different ones in actuality), and the install eventually succeeded without any issues.


I ran into this problem on a new MacBook Pro on Mac OS High Sierra. I gleaned brew was trying to use directories named include and lib under /usr/local that was not there. Since root owns /usr I had to do it manually - making sure that whoami owner matches peer directories in /usr/local:

sudo mkdir /usr/local/includechown `whoami`:admin /usr/local/include sudo mkdir /usr/local/libchown `whoami`:admin /usr/local/lib

And then to match the other directories in /usr/local I did:

chmod 775 /usr/local/includechmod 775 /usr/local/lib

then the following worked:

brew uninstall node brew install node