Repository: storybook
Issue: [Bug]: yarn v3 "@esbuild/linux-x64" is not found when running yarn build-storybook (Docker)
Labels: bug,help wanted,compatibility with other tools,sev:S3

### Describe the bug

When I run `storybook build` with yarn (v3) inside a docker container (with `node:19-alpine3.17`) i get an error message that the package `@esbuild/linux64` is missing and needed by esbuild. I have already tried different node images.

When I add the package manually, everything works fine. It also works when using npm.

### To Reproduce

https://github.com/bobmazy/storybook-test

### System

```shell
System:
  OS: Linux 5.10 Alpine Linux
  CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Binaries:
  Node: 19.8.1 - /usr/local/bin/node
  Yarn: 3.5.0 - /usr/local/bin/yarn
  npm: 9.5.1 - /usr/local/bin/npm
npmPackages:
  @storybook/addon-essentials: ^7.0.2 => 7.0.2
  @storybook/addon-interactions: ^7.0.2 => 7.0.2
  @storybook/addon-links: ^7.0.2 => 7.0.2
  @storybook/blocks: ^7.0.2 => 7.0.2
  @storybook/react: ^7.0.2 => 7.0.2
  @storybook/react-vite: ^7.0.2 => 7.0.2
  @storybook/testing-library: ^0.1.0 => 0.1.0
```


### Additional context

**Console Output**

4.140 @storybook/cli v7.0.2
 => Cleaning outputDir: /storybook-static
 Error: The package "@esbuild/linux-x64" could not be found, and is needed by esbuild.

 If you are installing esbuild with npm, make sure that you don't specify the
 "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
 of "package.json" is used by esbuild to install the correct binary executable
 for your current platform.
     at generateBinPath (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:1885:15)
     at esbuildCommandAndArgs (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:1955:33)
     at ensureServiceIsRunning (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2119:25)
     at startSyncServiceWorker (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2322:19)
     at Object.<anonymous> (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2363:3)
     at Module._compile (node:internal/modules/cjs/loader:1275:14)
     at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
     at require$$0.Module._extensions..js (/app/.pnp.cjs:21863:33)
     at Module.load (node:internal/modules/cjs/loader:1133:32)
     at require$$0.Module._load (/app/.pnp.cjs:21682:22)
  Error: The package "@esbuild/linux-x64" could not be found, and is needed by esbuild.

 If you are installing esbuild with npm, make sure that you don't specify the
 "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
 of "package.json" is used by esbuild to install the correct binary executable
 for your current platform.
     at generateBinPath (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:1885:15)
     at esbuildCommandAndArgs (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:1955:33)
     at ensureServiceIsRunning (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2119:25)
     at startSyncServiceWorker (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2322:19)
     at Object.<anonymous> (/app/.yarn/unplugged/esbuild-npm-0.17.14-fb0460a0aa/node_modules/esbuild/lib/main.js:2363:3)
     at Module._compile (node:internal/modules/cjs/loader:1275:14)
     at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
     at require$$0.Module._extensions..js (/app/.pnp.cjs:21863:33)
     at Module.load (node:internal/modules/cjs/loader:1133:32)
     at require$$0.Module._load (/app/.pnp.cjs:21682:22)