15

When I install watchman using brew install watchman, it got this Error: You must brew link pcre before watchman can be installed. So I try brew link pcre and brew link --overwrite pcre, I just got linking /usr/local/Cellar/pcre/8.36... Error: Could not symlink share/man/man3/pcre.3 /usr/local/share/man/man3 is not writable.

Can anyone help?

Tom
  • 770
  • 9
  • 18
  • Sounds like there is a permission issue with /usr/local/share/man/man3 . Have you checked the folder permissions for this folder? – jimrice Mar 28 '15 at 16:21

2 Answers2

36

By design Homebrew (brew) requires the contents of /usr/local to be owned by you. You can fix it easily by running:

sudo chown -R `whoami` /usr/local

from your Terminal.

See here for further explanation.

Opal
  • 81,889
  • 28
  • 189
  • 210
Kuba
  • 878
  • 7
  • 10
  • 1
    Actually chown doesn't work for me. I use 'chmod 777 /usr/local/share/man/man3' to get through. Thanks. – Tom Mar 31 '15 at 11:29
  • 1
    thanks. This solved so many issues I had with homebrew. Not sure how /usr/local got mucked up in the first place! – Domenic D. May 31 '15 at 15:20
  • 1
    I wouldn't recommend on going chmod 777 as this is way insecure. – pojda Jun 27 '16 at 15:58
5

first

sudo chown -R 'your name' /usr/local

then

brew link pcre -f

then

brew install watchman

it should work

winhowes
  • 7,845
  • 5
  • 28
  • 39
Wang Kevin
  • 167
  • 2
  • 3