[GitHub Actions] "Dependencies lock file is not found in ~" 에러

젬마·2023년 3월 22일
1

indiego 유지 보수

목록 보기
1/2

에러 상황

     - name: Setup Node
        uses: actions/setup-node@main
        with:
          node-version: 16
          cache: 'npm'

에러 원인

  • npm 패키지를 캐싱해야 하는데 경로가 /home/runner/work/indiego/indiego로 잘못 설정되어있는 것 같았음

해결 방법

  • 위 코드에 cache-dependency-path를 추가하여 경로를 설정해줌
      - name: Setup Node
        uses: actions/setup-node@main
        with:
          node-version: 16
          cache: 'npm'
          cache-dependency-path: ./client/package-lock.json

참고 자료

https://www.daleseo.com/github-actions-setup-node/
https://github.com/actions/setup-node#caching-packages-dependencies

의문점/아쉬운 점

  • 공식 문서에는 위 해결 방법이 모노 레포일 때 사용되는 방법이라고 나와있는데 우리 프로젝트에서는 모노 레포를 위한 설정을 따로 추가해준 적이 없다... (??)
  • 간단하게 해결되어서 다행이긴 한데 제대로 알고 한 건 아닌 느낌.
profile
취준생은 프론트엔드의 꿈을 꾸는가

0개의 댓글