문제 상황

Jenkins CI 서버에서 yarn install --frozen-lockfile 실행 시 Node.js 엔진 호환성 에러 발생.

에러 메시지

error @vitejs/[email protected]: The engine "node" is incompatible with this module.
Expected version "^20.19.0 || >=22.12.0". Got "20.10.0"

error [email protected]: The engine "node" is incompatible with this module.
Expected version "^20.19.0 || ^22.12.0 || >=24.0.0". Got "20.10.0"

환경 비교

환경 Node.js 버전 비고
Jenkins CI 20.10.0 lint/typecheck 실행
Docker (Dev/QA/Stg/Prod) 22 빌드 및 런타임

해결 방법

적용된 해결책

모든 Jenkinsfile에 --ignore-engines 옵션 추가.

# 변경 전
sh "yarn install --frozen-lockfile"

# 변경 후
sh "yarn install --frozen-lockfile --ignore-engines"

수정된 파일

영향 분석

프로덕션 영향: 없음

Jenkins의 yarn install은 lint/typecheck 실행을 위한 것으로, 실제 빌드는 Docker 내부에서 수행됨.

Jenkins (Node 20.10.0)
├── yarn install --ignore-engines  <- 엔진 체크만 무시
├── yarn lint                      <- ESLint 실행
├── yarn tsc --noEmit              <- 타입 체크
│
└── docker build
    │
    └── Docker 내부 (Node 22)
        ├── yarn install           <- 여기서 다시 설치 (문제없음)
        └── yarn build             <- 여기서 실제 빌드

환경 차이: 없음