I have two users on my Macbook Pro running macOS Mojave 10.14.2 - one for work and one for personal.
I set up React Native on both users installing the react native cli & watchman:
brew install watchman
sudo npm install -g react-native-cli
This worked and I was able to run the local server with npm start
.
I tried doing the same on the other user but was not able to install watchman with homebrew due to permissions issues.
I ran the following:
sudo chown -R $(whoami):admin $(brew --prefix)/*
And that fixed it. I was once again able to run the local dev server.
Except now when I went back to my other user, I was not able to run the server again.
I get the following error when running npm start
:
Loading dependency graph...libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: open: /usr/local/var/run/watchman/yev-state: Permission denied
Watchman: watchman --no-pretty get-sockname returned with exit code=null, signal=SIGABRT, stderr= libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: open: /usr/local/var/run/watchman/yev-state: Permission denied
I tried running sudo chown -R $(whoami):admin $(brew --prefix)/*
again which didn't fix it this time.
I also looked up how to configure Homebrew for multi-users macs and found this short article.
I created a user group called "brew", added both my work and personal users to it and ran the following:
sudo chgrp -R brew $(brew --prefix)/*
sudo chmod -R g+w $(brew --prefix)/*
Still no dice.
I am not able to get it where I can freely user homebrew or run the dev server (due to watchman permissions error) on both users. I have to "fix" the permissions issue every time I change users.