0

When I follow these instructions on an M2 MBA using Expo SDK 47.0.13 and EAS CLI 3.5.2 (darwin-arm64) I get

    InvalidEasJsonError: eas.json is not valid.
    - "build.dev-hardware.resourceClass" must be one of [default, medium]

which seems like a direct contradiction of those instructions. Why isn't the specified value (m1-medium) recognized as valid?

orome
  • 45,163
  • 57
  • 202
  • 418

2 Answers2

1

I had the same issue and I solved it by updating my eas-cli on global level. In my situation I tried updating it with

npm install -g eas-cli

If you've used a different package manager like I did to install eas-cli earlier, you may need to run the command accordingly. In my case it was

yarn global add eas-cli

Also, it's maybe worth checking if in your eas.json file you have any setting related to the cli version like this:

{
  "cli": {
    "version": ">= 3.3.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "production": {
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  }
}

EDIT

I remembered that when this was happening, whenever I ran eas build the console printed a message like this:

enter image description here

I ran the suggested npm install command, but message was still prompted, which led me to believe that yarn was in control of the version of the eas-cli that executes eas build. This is why I ran yarn global add, which fixed the issue.


iatanasov
  • 21
  • 3
  • Are you saying I need Yarn project at the root? Currently I don't have one there, just some `npm -g` installed tools. And the version of Yarn there is ([has to be](https://stackoverflow.com/a/59934413/656912)) [1.22.19](https://discourse.jupyter.org/t/yarn-error-fatal-on-executing-jupyterlab/15777/10?u=orome) and not 3.2.3 (used in my projects). – orome Feb 17 '23 at 16:23
  • No. Especially if you do not use Yarn for the current project. I just found an expo forum thread that explains how expo-cli version could be conflicting with the one listed as installed from yarn. Solutions depend on what suits you best: uninstall expo-cli from yarn or just upgrade it in yarn as I did. [Here is the link to the forum](https://forums.expo.dev/t/cant-upgrade-to-the-lastest-expo-cli-3-19-2/36764) – iatanasov Feb 18 '23 at 06:05
0

I had same issue when tried to start script from the package.json

yarn build:ios

Run command directly in the terminal works properly

eas build --profile dev --platform ios