why am i getting this error when running `eas build`

Could it be that your project’s repository is not initialized by Git? If not, you have to initialize it with Git.

Here is a similar issue that got resolved: Error: EPERM: operation not permitted, scandir - #2 by wkozyra.