터보레포로 스토리북을 실행하는데 자꾸 에러가 뜬다.
m1 맥북 사용중이고 pnpm으로 설치했다. (에러메시지 하단 참고)
darwin-x64
로 설치되어서 storybook 실행에 오류가 발생함에러메시지
Error:
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the "@esbuild/darwin-x64" package is present but this platform
needs the "@esbuild/darwin-arm64" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
If you are installing with npm, you can try ensuring that both npm and node are
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
changing how you installed npm and/or node. For example, installing node with
the universal installer here should work: https://nodejs.org/en/download/. Or
you could consider using yarn instead of npm which has built-in support for
installing a package on multiple platforms simultaneously.
If you are installing with yarn, you can try listing both "arm64" and "x64"
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
*arm64와 x64는 CPU 아키텍처를 나타내는 용어
ARM64 (ARM 아키텍처):
주로 모바일 기기(스마트폰, 태블릿)와 임베디드 시스템에 사용됩니다.
전력 효율성이 높고, 모바일 기기에서 배터리 수명을 개선하는 데 중점을 둡니다.
ARM 프로세서는 주로 에너지 효율적이며 작은 크기의 장치에서 선호됩니다. Apple의 M1 칩은 ARM64 아키텍처를 기반으로 합니다.
Qualcomm, Samsung, MediaTek 등이 제조하는 모바일 기기에 ARM64 아키텍처를 사용합니다.
x64 (x86-64 또는 AMD64 아키텍처):
주로 서버 및 개인 컴퓨터에서 사용됩니다.
64비트 아키텍처로, 더 많은 주소 공간과 높은 성능을 제공합니다.
대부분의 데스크탑 및 노트북 컴퓨터에서 x64 아키텍처를 사용합니다.