So I’m getting this error every time I run any react native application on my system.
The metro builder crashes almost instantaneously as soon as I start the application.
This happens with expo and react native cli apps both.
While in this screenshot I’m using a monorepo, I have encountered this error in other react native applications too.
I have tried opening vscode in admin mode but the error is still there.
Have also tried changing the prefix using the
npm edit config
Would really appreciate some help on this.
2
Answers
Try This :->
TL;DR; Have Metro ignore changes in the respective directory
metro.config.js
in your project’s root directory.What’s going on
To implement hot reloading, Metro is constantly watching for file changes in the project directory. In your case, Metro tried to read the information on a file without having the necessary permissions.
.git/fsmonitor--deamon
ironically watches for file changes, too, and creates cookie files in the process. These cookies are only for use by git itself, therefore the restrictive access policy.