oven-sh / bun

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

`MissingPackageJSON` error should show directory #2451

Open Electroid opened 1 year ago

Electroid commented 1 year ago

package.json

{
  "dependencies": {
     "lodash": "./doesnotexist"
   }
}

Output:

bun install v0.5.8 (1a25af5e)

error: MissingPackageJSON
bun could not find a package.json file.

If I have lots of dependencies, it's not clear where the error is happening. The error should show the directory where the error is happening. We should check this works for workspaces too.

fregante commented 1 year ago

I'm seeing it in v1.0.3-v1.0.6

Screenshot

Also the error itself appears to be tracked in https://github.com/oven-sh/bun/issues/5483