eas build fails with "package.json does not exist"

Hi, I’m new to eas and can’t get it to work.

Command ‘expo build:android -t app-bundle’ works fine and I can see the app build successfully on Expo’s servers. However command ‘eas build --platform android’ fails with error “The expected package.json path: /root/workingdir/build/package.json does not exist”. In both cases I’m running the command from my app’s root directory (which contains file package.json).

Note: I’m unable to debug by running ‘eas build’ locally because I’m running on a windows machine (so not supported). How do I debug / fix?

Hi @moconnor

My guess is that package.json is not committed to Git, or you have package.json in your .gitignore file (or less likely you have package.json in a .easignore file.)

You’re exactly right (about my .gitignore file - which is a bit embarassing :slight_smile:), now fixed thanks!

1 Like

@wodin Hi, my package.json is not included in .gitignore but still it gives me the same error. Any help with that?

Hey @yashsharma05,

Can you confirm if your project includes a package.json and is not a monorepo?

What’s the structure of your project? Do you have app.json and package.json in the root directory of your project and a .git directory also at the root?

See this document for how the project is uploaded to the build servers. You can run the eas build:inspect ... command mentioned there to see exactly what will be uploaded:

expo.fyi/eas-build-archive

1 Like

The structure is like this :
Main folder > Client folder, Backend folder and a .git folder

The expo code is in the client folder while the .git folder is in the main folder.

Im running the eas build in the client folder.

OK, so it’s a monorepo. Expo has some support for monorepos, described here:

I have not used Expo in a monorepo, so I can’t give you more info about it than the above, and perhaps the following link which may or may not help:
expo.fyi/eas-vcs-workflow