민프

[React][TypeScript][StoryBook] Error: The package "@esbuild/darwin-arm64" could not be found, and is needed by esbuild. 본문

[React Error]

[React][TypeScript][StoryBook] Error: The package "@esbuild/darwin-arm64" could not be found, and is needed by esbuild.

민프야 2023. 5. 15. 18:55
ERR! Error: The package "@esbuild/darwin-arm64" could not be found, and is needed by esbuild.
ERR! 
ERR! If you are installing esbuild with npm, make sure that you don't specify the
ERR! "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
ERR! of "package.json" is used by esbuild to install the correct binary executable
ERR! for your current platform.
ERR!     at generateBinPath (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:1885:15)
ERR!     at esbuildCommandAndArgs (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:1955:33)
ERR!     at ensureServiceIsRunning (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2119:25)
ERR!     at startSyncServiceWorker (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2322:19)
ERR!     at Object.<anonymous> (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2363:3)
ERR!     at Module._compile (node:internal/modules/cjs/loader:1105:14)
ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
ERR!  Error: The package "@esbuild/darwin-arm64" could not be found, and is needed by esbuild.
ERR! 
ERR! If you are installing esbuild with npm, make sure that you don't specify the
ERR! "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
ERR! of "package.json" is used by esbuild to install the correct binary executable
ERR! for your current platform.
ERR!     at generateBinPath (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:1885:15)
ERR!     at esbuildCommandAndArgs (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:1955:33)
ERR!     at ensureServiceIsRunning (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2119:25)
ERR!     at startSyncServiceWorker (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2322:19)
ERR!     at Object.<anonymous> (/Users/minseokoh/StoryBookTest/mrpcrypto-front/node_modules/esbuild/lib/main.js:2363:3)
ERR!     at Module._compile (node:internal/modules/cjs/loader:1105:14)
ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

위 에러가 나왔는데 구글링 하다가
https://github.com/evanw/esbuild/issues/1646

 

Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild · Issue #1646 · evanw/esbuild

❯ uname -a Linux ltl065 5.10.0-8-amd64 #1 SMP Debian 5.10.46-5 (2021-09-23) x86_64 GNU/Linux # debian bullseye (stable) ❯ yarn --version 1.22.5 ❯ node --version v16.10.0 example project using a js ...

github.com

npm i -D esbuild

이것을 하면 된다고 뭘까 해서 알아보았는데
npm i -D esbuild 명령은 esbuild 패키지를 개발 종속(dependency)으로 설치하는 명령이다
https://esbuild.github.io/

 

esbuild - An extremely fast bundler for the web

esbuild An extremely fast bundler for the web Above: the time to do a production bundle of 10 copies of the three.js library from scratch using default settings, including minification and source maps. More info here. Our current build tools for the web ar

esbuild.github.io

esbuild는 JavaScript 및 TypeScript를 빠르게 번들링하고 트랜스파일링하는 도구이고, 이 도구를 사용하면 프로젝트의 JavaScript/TypeScript 파일을 최적화하고 번들링하여 성능을 향상시킬 수 있다고 한다.

일반적으로 프로젝트에서 esbuild를 사용하려면 npm i -D esbuild 명령을 실행하여 개발 종속(dependency)으로 설치한 후, 프로젝트 빌드 스크립트 또는 빌드 도구에 esbuild를 통합하여 사용하게 사용되는데, 예를 들어, esbuild를 사용하여 React 애플리케이션을 번들링하는 경우, esbuild를 웹팩(Webpack) 또는 Parcel과 통합하여 사용할 수 도 있다.

 

위 의 코드를 실행한 결과 해결 되었다. 

Comments