4
votes

I have been facing this issue since yesterday and am unable to resolve. I have gone through all github issues filed for react native and watchman, none helped to resolve the issue.

When I try to start react-native inside my project folder using command:

react-native start

Following log is thrown in terminal:

[4:57:26 PM] Building Dependency Graph [4:57:27 PM] Crawling File System [Hot Module Replacement] Server listening on /hot

React packager ready.

Failed to build DependencyGraph: Watchman error: Cannot read property 'root' of null. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html. Error: Watchman error: Cannot read property 'root' of null. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html. at /Users/anum/Desktop/Practice/QuizReact/node_modules/node-haste/lib/crawlers/watchman.js:63:11 at process._tickCallback (internal/process/next_tick.js:103:7)

I have updated both watchman and brew to latest versions. Please can someone point me towards right way to solve this problem? Thanks.

1

1 Answers

4
votes

Finally I managed to run the react native app successfully. I first updated npm using:

sudo npm update

I deleted my old project, created a new react native project. Then executed these commands step by step, thanks to the person commented:

brew update
brew uninstall watchman
brew install watchman --HEAD

This time logs did show that both brew and watchman got updated. Last time I ran commands, they pointed out that my watchman was already updated. It was most probably because npm was old, and react-native requirements were not fulfilled. So make sure, you have updated all react-native stuff to latest versions.

After updating watchman, I started react-native server in my project's directory using:

react-native start

After that, I was able to build and run the project successfully without any error. Hopefully, this answer helps someone!