Repository navigation
eas.json の node 固定と engines.node を撤廃して EAS Submit の npm ci 失敗を解消 - #5857
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughpackage.json から Changes
Sequence Diagram(s)(該当なし) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 分 Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
package.json
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
概要
Create Production BuildsワークフローのSubmit to Google Play Storeジョブ(type: submit)が、EAS 内部で実行するnpm ci --include=devでEBADENGINE失敗する問題を修正する。eas.jsonの Build プロファイルだけ Node を22.17.0に固定できていたが、Submit プロファイル側には Node を固定する手段が無い。この非対称を Build 側の node 固定も撤廃する形で解消する。変更の種類
変更内容
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 を同じ内容にミラー更新するだけ。背景 / 経緯
engines: {node: 22.x, npm: 10.x}と.npmrcのengine-strict=trueを追加。eas.jsonのbuild.*.node: "22.17.0"で対応済み。app.config.tsを評価するため EAS 内部でnpm ci --include=devを走らせる仕様で、Submit プロファイルには Node バージョンを固定するフィールドが無い(EAS CLI 18.7.0 の@expo/eas-jsonのUnresolvedSubmitProfileSchemaにnode/env/imageのいずれも存在しない)。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 installが CI 互換 lockfile を壊す問題の防止)。これはengines.npm: 10.x+engine-strict=trueで今後も継続して効く。.nvmrcとmise.tomlが引き続き22を指すので、通常の開発フローは Node 22 のまま。engines から node を外しても実運用上はほぼ変わらない。採用しなかった代替案
engine-strict=falseに緩める: npm 11 のインストールもスルーしてしまうため不可engines.nodeを20.x || 22.x等に列挙: EAS 既定の Node が上がるたびに追随が必要で、ポリシーとしての意味が薄いapp.config.ts→app.json静的化: 影響範囲が広く、動的 config を失う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 する。
スクリーンショット(任意)