Skip to content

Node.js 버전이 낮으면 런처가 버전 부족을 먼저 알리게 했다 - #97

Merged
SonAIengine merged 1 commit into
mainfrom
fix/launcher-node-version-guard
Oct 25, 2026
Merged

SonAIengine merged 1 commit into
mainfrom
fix/launcher-node-version-guard

Conversation

@SonAIengine

Copy link
Copy Markdown
Contributor

문제

플랫폼 패키지는 optional이고 engines.node >=22.14.0이라서, Node 20에서는 npm이 아무 말 없이 설치를 건너뛴다. 그러면 런처가 Reinstall @xgen-ai/cli without --omit=optional.이라고 안내하는데, 실제 원인과 다른 안내다.

변경

  • npm/packages/cli/lib/platform.cjs에 checkNodeVersion(engine, version)을 추가했다. 런처는 플랫폼을 고르기 전에 이 검사를 먼저 한다.
  • 최소 버전은 런처 package.json의 engines.node에서 읽는다. 원본은 config.mjs의 nodeEngine 하나고, check.mjs가 둘이 같은지 이미 검사하고 있다.
  • 판정할 수 없는 engines 형식은 통과시키지 않고 오류로 처리한다.

검증

  • npm test 17개 통과(새 테스트 3개 포함), npm run check 통과
  • Docker에서 rc.4를 전역 설치한 뒤 런처만 이번 수정본으로 바꿔 실행했다.
    • node:20-slim (v20.20.2): XGEN requires Node.js 22.14.0 or later (current: v20.20.2). Upgrade Node.js, then reinstall @xgen-ai/cli. 출력, exit 1
    • node:22-slim (v22.23.2): xgen 0.1.0-rc.4, exit 0

🤖 Generated with Claude Code

플랫폼 패키지 5개는 optional이고 engines.node >=22.14.0 이라서 Node 20에서는
npm이 경고 없이 설치를 건너뛴다. 그러면 런처가 바이너리를 못 찾고
"--omit=optional 없이 재설치하라"는 엉뚱한 안내를 냈다. 실제로 이 안내 때문에
설치가 깨진 것으로 오진한 적이 있다.

- 런처가 플랫폼을 고르기 전에 process.version 을 자기 package.json 의
  engines.node 와 비교한다. 최소 버전은 따로 적지 않고 manifest 에서 읽으므로
  config.mjs 의 nodeEngine 하나가 원본으로 남는다(check.mjs 가 일치를 검사).
- 판정할 수 없는 engines 형식은 조용히 통과시키지 않고 오류로 처리한다.
- 테스트 3개 추가(경계값 v22.13.1/v22.14.0 포함), npm test 17개와 npm run check 통과.

Docker 실측(rc.4 전역 설치 후 런처만 교체):
- node:20-slim v20.20.2: 기존 "--omit=optional" 안내 → "XGEN requires
  Node.js 22.14.0 or later (current: v20.20.2)" 로 바뀌고 exit 1
- node:22-slim v22.23.2: xgen 0.1.0-rc.4, exit 0 (기존 동작 유지)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SonAIengine
SonAIengine merged commit 52f17c9 into main Oct 25, 2026
3 checks passed
@SonAIengine
SonAIengine deleted the fix/launcher-node-version-guard branch October 25, 2026 11:07
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