英文:
Using "m1-medium" not recognized as valid by EAS
问题
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?
英文:
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?
答案1
得分: 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
我遇到了相同的问题,并通过在全局级别更新我的 eas-cli 来解决它。在我的情况下,我尝试使用以下命令进行更新:
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
如果你之前使用了不同的包管理器来安装 eas-cli,就像我一样,你可能需要相应地运行命令。在我的情况下,我使用了以下命令:
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:
此外,也许值得检查一下你的 eas.json 文件中是否有与 cli 版本相关的设置,就像这样:
{
"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:
我记得当这个问题发生时,每当我运行 eas build
时,控制台会打印出类似这样的消息:
I ran the suggested npm install command, but the 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.
我运行了建议的 npm 安装命令,但消息仍然出现,这让我相信 yarn 控制了执行 eas build
的 eas-cli 版本。这就是为什么我运行了 yarn global add,这解决了问题。
英文:
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:
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.
答案2
得分: 0
我在尝试从package.json启动脚本时遇到了相同的问题
yarn build:ios
在终端中直接运行命令正常工作
eas build --profile dev --platform ios
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论