For instance, say I'm in the parent folder of app folder where package.json is, and I want to install dependencies for app without cd into it.
I tried:
bun --prefix app install # the npm way
bun --dir app install # the pnpm way
bun --cwd app install # the bun way, but only works with `run` scripts like `bun start`
None of the above worked. Is it supported at all?
If the directory structure is parent > app > package.json and you are currently in parent, you can install all dependencies with this command:
bun install --cwd ./app
If you need to install a new dependency, for example react, you can use this command:
bun add react --cwd ./app
This command will also create a package.json file if not present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With