GitHub Actions node 버전 명시

hansol yang
Dec 6, 2021

--

참고: https://github.com/actions/setup-node

GitHub 의 Actions 를 사용하는 경우 The engine "node" is incompatible with this module. 라는 에러를 만나는 경우가 있다. 이것은 yml 파일에 노드의 버전을 직접 명시하지 않을 경우 임의로 버전이 채택되어 Action 을 실행하기 때문이다. 그렇기 때문에 되도록이면 버전을 명시해서 사용하는 것을 권한다고 한다.

노드 버전은 node-version 을 사용하여 명시할 수 있다.

가장 기본적인 사용 예는 다음과 같다.

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm install
- run: npm test

위의 예에서 node-version 을 명시하는 부분을 참고해 원하는 형태로 파일을 구성하면 된다.

명시할 수 있는 버전의 예는 아래와 같다.

major versions: 12, 14, 16

more specific versions: 10.15, 14.2.0, 16.3.0

nvm lts syntax: lts/erbium, lts/fermium, lts/*

--

--

No responses yet