oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.43k stars 2.78k forks source link

bun run dev for turborepo does not work #11599

Open AlexShiresRoth opened 5 months ago

AlexShiresRoth commented 5 months ago

What version of Bun is running?

1.1.10+5102a9443

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. npx create-turbo
  2. select bun workspaces
  3. bun run dev Screenshot 2024-06-04 105600

What is the expected behavior?

For it to run the dev server

What do you see instead?

error: bin executable does not exist on disk web:dev: web:dev: Bun failed to remap this bin to its proper location within node_modules. web:dev: This is an indication of a corrupted node_modules directory. web:dev: web:dev: Please run 'bun install --force' in the project root and try web:dev: it again. If this message persists, please open an issue: web:dev: https://github.com/oven-sh/bun/issues web:dev: web:dev: error: script "dev" exited with code 255

Additional information

No response

lukewlms commented 5 months ago

It may work prefixing the relevant script statements with "bunx". We had to do that for all our scripts to work on Windows, though it would be nice not to have to do that, e.g. "scripts" { "start": "bunx ts-node..." }

doreenhuang57 commented 5 months ago

I'm also on Windows and ran into the same issue with vite, prefixing the script statement with bunx --bun worked for me (so with vite we used "dev": "bunx --bun vite").

We also have nested package.json files in our project:

project
├── package.json
├── ...
├── client
│   ├── package.json
│   └── ...

Our "dev" script was in the client folder's package.json, we found that if we took the client folder out of the project folder, the bin executable error did not appear.