본문 바로가기

카테고리 없음

Cloudflare Node.js 버전 문제 해결 [다른 언어 배포도 참고 가능]

반응형

최근 Couldflare를 사용해서 React 배포를 진행했는데. 문제가 있었습니다

17:34:11.756	warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
17:34:11.761	[1/4] Resolving packages...
17:34:12.401	[2/4] Fetching packages...
17:35:14.165	error @faker-js/faker@7.6.0: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.18.0"

 

 Expected version ">=14.0.0". Got "12.18.0"

Node Version 이 안맞다고 하네요..;;

CloudFlare 언어별 지원 버전 확인해보니 Node 12.18.0버전이네요.

 

해결방법

1. Environment variable 의 값을 [NODE_VERSION]으로 하고 추가하거나

2. 디렉토리 내에 .nvmrc파일을 만들어주면 될 것 같습니다.

 

저는 2번째 방법으로 해보겠습니다.

현재 터미널창에 아래와 같이 입력해주면 .nvmrc파일에 노드 버전이 잘 적혀서 추가된걸 확인할 수 있습니다.

node -v > .nvmrc

 

1번 방법은 Settings에서 변수를 추가해주면 될 것 같습니다 :)

 

 

참조

https://velog.io/@lxxonx/Cloudflare-pages-%EC%82%AC%EC%9A%A9%EC%8B%9C-Node.js-%EB%B2%84%EC%A0%84-%EC%84%A4%EC%A0%95

 

Cloudflare pages 사용시 Node.js 버전 설정

현재 프론트엔드 배포자동화 툴을 github actions + aws ecs 에서 cloudflare pages로 변경하고자합니다.그러나 cloudflare의 기본 node.js 버전이 12.18.0 인 관계로 배포과정에 문제가 발생하였습니다.참고:https:

velog.io

 

반응형