민프
[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:55ERR! 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
npm i -D esbuild
이것을 하면 된다고 뭘까 해서 알아보았는데
npm i -D esbuild 명령은 esbuild 패키지를 개발 종속(dependency)으로 설치하는 명령이다
https://esbuild.github.io/
esbuild는 JavaScript 및 TypeScript를 빠르게 번들링하고 트랜스파일링하는 도구이고, 이 도구를 사용하면 프로젝트의 JavaScript/TypeScript 파일을 최적화하고 번들링하여 성능을 향상시킬 수 있다고 한다.
일반적으로 프로젝트에서 esbuild를 사용하려면 npm i -D esbuild 명령을 실행하여 개발 종속(dependency)으로 설치한 후, 프로젝트 빌드 스크립트 또는 빌드 도구에 esbuild를 통합하여 사용하게 사용되는데, 예를 들어, esbuild를 사용하여 React 애플리케이션을 번들링하는 경우, esbuild를 웹팩(Webpack) 또는 Parcel과 통합하여 사용할 수 도 있다.
위 의 코드를 실행한 결과 해결 되었다.
'[React Error]' 카테고리의 다른 글
[React][Error] TIL, 정규표현식 Invalid regular expression (2) | 2023.06.08 |
---|---|
[React][TypsScript] axios 첫 렌더링시 localhost Token값이 null인 이유? (0) | 2023.04.10 |
[React][TypeScript] Type 'any' is not assignable to type 'never'. (0) | 2023.04.04 |
Comments