oven-sh / bun

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

ENOENT: Bun could not find a file, and the code that produces this error is missing a better error. #10743

Open samyarkd opened 5 months ago

samyarkd commented 5 months ago

What version of Bun is running?

1.1.6

What platform is your computer?

Ubuntu WSL

What steps can reproduce the bug?

remove bun lock file and try to add a new dependency, unless you run bun install the error still persists. but even after doing it still gives error after doing one installation. (it works only once per adding a new dependency).

What is the expected behavior?

a new lock file be created but it does not get created

What do you see instead?

no lock file

Additional information

No response

raggesilver commented 5 months ago

I've been getting this constantly while working on a monorepo with Bun workspaces. Running bunx shadcn-vue@latest add <any component> tries installing new dependencies, but fails (due to this issue). Running bun i and re-runing the shadcn-vue command works...

rogersx27 commented 5 months ago

I got the same issue when a try bun i in Ubuntu WSL image

But instead, I have the file bun.lockb image

Any solutions?

svenit commented 4 months ago

@rogersx27 let run npm i -g bun and run bun i again. It works for me