How to solve Error jest-haste-map Watchman crawl failed.

When using Jest for the first time, you might encounter this error

Error: jest-haste-map: Watchman crawl failed. Retrying once with node crawler.

which happen on Mac OS.

We need to install watchman for this. Example using brew

brew uninstall watchman

Or if you need to reinstall it

brew reinstall watchman

AND you need to give it access (permission to your folder).
By go to > System Preferences > Security & Privacy > Privacy > Files and Folders

And allow watchmen (tick the checkbox) for Files and Folder screenshot

Refrence of this issue:

testing jest