yarn
Yarn V1에서 V4로 마이그레이션하는 방법
Yarn V1에서 V4로 마이그레이션하는 방법
2024.03.11Yarn V1에서 의존성을 추가하면 CommonJS, ESM 모듈 간 충돌하는 이슈가 지속적으로 발생해서 Yarn V4로 마이그레이션 하는 작업을 진행하였다. 본 글에서는 Yarn Classic이라고 부르는 V1에서 Yarn Berry(Yarn V2+을 지칭하는 명칭)로 마이그레이션 하는 방법에 대해 알아본다. 1. Yarn 버전 확인 yarn -v 를 입력해서 현재 yarn 버전을 확인한다. 명령어를 실행하니 1.22.22 버전이 설치되어 있다. $ yarn -v 1.22.22 2. Node 버전 확인 Yarn Berry로 업그레이드하기 위해서는 Node.js 18 버전 이상이 설치되어있어야 한다. node -v 명령어로 버전을 확인해 보니 20.10.0 버전이 설치되어 있다. 만약 18 버전보다 낮다..
[오류해결] Error [ERR_REQUIRE_ESM]: require() of ES Module ~ node_modules/cliui/build/index.cjs not supported.
[오류해결] Error [ERR_REQUIRE_ESM]: require() of ES Module ~ node_modules/cliui/build/index.cjs not supported.
2024.03.11오류 발생 yarn test 명령어로 테스트 코드를 실행하려는데 아래와 같이 오류가 발생했다. yarn v1.22.21 node 20.10.0 오류 상세 yarn test yarn run v1.22.21 $ jest Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/iksflow/${PROJECT_ROOT}/node_modules/string-width/index.js from /Users/iksflow/${PROJECT_ROOT}/node_modules/cliui/build/index.cjs not supported. Instead change the require of index.js in /Users/iksflow/${PROJECT_ROOT}/node..