How to Resolve Error: Watchman error: watchman::RootResolveError:

3.7k Views Asked by At

I am at a loss.

I have tried reinstalling watchman, I've tried deleting all watchman instances and then restarting my react native app. I can do watchman watch . in my project's directory and get a positive response.

I also have a .watchmanconfig file with an empty object ({}) in my project root.

I have tried the below:

watchman watch-del-all
watchman shutdown-server
rm -rf /usr/local/var/run/watchman/root-state

I got no errors while running these commands but after doing them and then running react-native start.

I've also tried going to System Preferences > Security & Privacy > Full Disk Access but in the list I can't find watchman to allow it access. It just doesn't show up.

The full error is below.

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: watchman::RootResolveError: failed to resolve root: unable to resolve root .: failed to resolve root: path "." must be absolute. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.

I am out of ideas. Any insight would be very much appreciated.

Current Specs

OS: macOS Monterey 12.4
node: 16.5
watchman: 2022.06.06.00
react-native-cli: 2.0.1
react-native: 0.64.0 
1

There are 1 best solutions below

1
sabdahtb On

watchman watch-del-all

watchman shutdown-server

rm -rf /usr/local/var/run/watchman/root-state

I try this before run my react native App and its work