Skip to content

eas.json の node 固定と engines.node を撤廃して EAS Submit の npm ci 失敗を解消 - #5857

Merged
TinyKitten merged 2 commits into
devfrom
fix/eas-submit-node-engines
Apr 21, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/eas-submit-node-engines

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

概要

Create Production Builds ワークフローの Submit to Google Play Store ジョブ(type: submit)が、EAS 内部で実行する npm ci --include=dev で EBADENGINE 失敗する問題を修正する。

npm error notsup Not compatible with your version of node/npm: [email protected]
npm error notsup Required: {"node":"22.x","npm":"10.x"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v20.19.4"}

eas.json の Build プロファイルだけ Node を 22.17.0 に固定できていたが、Submit プロファイル側には Node を固定する手段が無い。この非対称を Build 側の node 固定も撤廃する形で解消する。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • eas.json の build.development / build.preview / build.production の "node": "22.17.0" を削除(EASビルド環境のNodeを22.17.0に明示指定 #5852 の事実上の revert)。
  • package.json の engines.node を撤廃。engines.npm: "10.x" はそのまま残す。
  • package-lock.json は root の engines を同じ内容にミラー更新するだけ。

背景 / 経緯

  • Node 22.x / npm 10.x を .nvmrc と engines で固定 #5849 で engines: {node: 22.x, npm: 10.x} と .npmrc の engine-strict=true を追加。
  • EASビルド環境のNodeを22.17.0に明示指定 #5852 で EAS Build 側は eas.json の build.*.node: "22.17.0" で対応済み。
  • しかし EAS Submit は Android の app.config.ts を評価するため EAS 内部で npm ci --include=dev を走らせる仕様で、Submit プロファイルには Node バージョンを固定するフィールドが無い(EAS CLI 18.7.0 の @expo/eas-json の UnresolvedSubmitProfileSchema に node / env / image のいずれも存在しない)。
  • そのため EAS 既定の Node 20.19.4 で npm ci が走り、engine-strict=true + engines.node: 22.x により EBADENGINE で弾かれていた。

なぜ「Build の node 固定も外す」方を選んだか

  • engine-strict=true を維持する限り、engines.node で指定した範囲と実際に使われる Node を完全一致させる必要がある。EAS は Build / Submit で Node の制御手段が非対称(Build は指定可、Submit は不可)なので、「Node を 22 に強制する」ポリシーと「EAS で安定に動かす」ポリシーは原理的に両立しない。
  • メモでも明示されているように、本当に守りたいガードは npm 10.x(npm 11 の npm install が CI 互換 lockfile を壊す問題の防止)。これは engines.npm: 10.x + engine-strict=true で今後も継続して効く。
  • ローカル開発者向けには .nvmrc と mise.toml が引き続き 22 を指すので、通常の開発フローは Node 22 のまま。engines から node を外しても実運用上はほぼ変わらない。
  • eas.json の node 固定だけ残すと Build と Submit で非対称なまま(Build は Node 22、Submit は Node 20)になるので、どちらも EAS 既定に任せる形に揃える。

採用しなかった代替案

  • engine-strict=false に緩める: npm 11 のインストールもスルーしてしまうため不可
  • engines.node を 20.x || 22.x 等に列挙: EAS 既定の Node が上がるたびに追随が必要で、ポリシーとしての意味が薄い
  • app.config.ts → app.json 静的化: 影響範囲が広く、動的 config を失う
  • EAS Submit プロファイルへの node フィールド追加を Expo にリクエスト: 別途フィードバック予定だが即時解決にならない

テスト

  • npm run lint が通ること
  • npm test が通ること(148 suites / 1398 tests)
  • npm run typecheck が通ること

Submit 自体の通過確認はマージ後の production リリースで検証する。

関連Issue

#5849 で導入した engines 制約の fallout の仕上げ。#5852 の対応(Build 側の node 固定)も本 PR で事実上 revert する。

スクリーンショット(任意)

@TinyKitten TinyKitten self-assigned this Apr 21, 2026
@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

package.json から engines.node 制約("22.x")が削除され、eas.json の各 build プロファイルから build.*.node("22.17.0")設定が削除されました。その他の設定は変更されていません。

Changes

Cohort / File(s) Summary
Node エンジン定義の削除
package.json
engines.node("22.x")を削除。engines.npm は維持。
EAS ビルドのNode指定削除
eas.json
build.development.node, build.preview.node, build.production.node("22.17.0")を削除。その他プロファイル設定はそのまま。

Sequence Diagram(s)

(該当なし)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分

Possibly related PRs

Poem

🐰 バージョンの木をぴょんと越えて、
古い釘は外して、道を広げる、
どの枝を選んでも風は同じ、
ふわふわ跳ねて、コードも軽やか、
新しい朝へ、にんじん片手に 🌤️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはPRの主な変更内容(eas.json と engines.node を撤廃して EAS Submit の npm ci 失敗を解消)を正確に反映している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed プルリクエストの説明は提供されたテンプレート構造に大部分が従っており、必要なセクションが揃っている。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/eas-submit-node-engines

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
package.json (1)

121-121: EAS Submit 対応として妥当な変更です。

engines.node を "22.x || 20.x" に拡張することで、EAS Submit のデフォルト環境(Node 20.19.4)での npm ci 実行時のエラーが解消されます。engines.npm: "10.x" は維持されており、npm 11 以降からの保護という目的は達成されています。

ただし、functions/package.json では "node": "22" のみを要求しているため、ルート package.json が Node 20.x を許容する一方で、functions サブパッケージは Node 22 を厳密に要求する不整合が生じます。開発者が Node 20.x を使用する場合、functions ディレクトリ配下での操作で問題が発生する可能性があります。公式な開発ターゲットが Node.js 22.x であることに加えて、この不整合についてもドキュメントや開発ガイドに明記することを検討してください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 121, The root package.json's engines.node was widened
to "22.x || 20.x" but functions/package.json still pins "node": "22", causing an
engines mismatch; either align them by updating functions/package.json's
engines.node to "22.x || 20.x" (or tighten root to "22.x" if Node 22 is
required) and add a short note in developer docs/README about the official
target Node version and any EAS Submit considerations so contributors understand
the discrepancy; update the engines key in the functions package
(functions/package.json) and the docs accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@package.json`:
- Line 121: The root package.json's engines.node was widened to "22.x || 20.x"
but functions/package.json still pins "node": "22", causing an engines mismatch;
either align them by updating functions/package.json's engines.node to "22.x ||
20.x" (or tighten root to "22.x" if Node 22 is required) and add a short note in
developer docs/README about the official target Node version and any EAS Submit
considerations so contributors understand the discrepancy; update the engines
key in the functions package (functions/package.json) and the docs accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34e6071f-f730-4329-895e-068927798dab

📥 Commits

Reviewing files that changed from the base of the PR and between 8f4e8bd and f1714a9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

@TinyKitten TinyKitten changed the title engines.node を 22.x || 20.x に広げて EAS Submit の npm ci 失敗を解消 eas.json の node 固定と engines.node を撤廃して EAS Submit の npm ci 失敗を解消 Apr 21, 2026
@TinyKitten
TinyKitten merged commit 9959b80 into dev Apr 21, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/eas-submit-node-engines branch April 21, 2026 06:47
@TinyKitten TinyKitten mentioned this pull request May 9, 2026
7 of 9 tasks
@TinyKitten TinyKitten mentioned this pull request Jun 17, 2026
1 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant