bun
bun copied to clipboard
Install Dev dependencies
What is the problem this feature would solve?
npmoffers the possibility to install devDependencies. It seems that bun currently does not offer this feature. All dependencies installed with bun are installed as normal dependencies. It would be great to add the -dflag to bun installso that we can install dependencies as devDependencies.
What is the feature you are proposing to solve the problem?
bun install -d
What alternatives have you considered?
Installing dependency with bun installand manually move them to devDependencies.
Seconding this, I would really like dev dependency support
https://bun.sh/docs/cli/install#add-and-remove-packages
bun add --development @types/react
bun add -d @types/react
My 2 cents on this
Rest of the ecosystem:
| Manager | Flags |
| Yarn@1 / Berry | --dev / -D |
| Npm | --save-dev / -D (but also accepts --dev as an internal alias) |
| Pnpm | --save-dev / -D |
Bun meanwhile fails for -D and prints out usage for --dev
I suggest adding -D/--dev as aliases to --development, to make it so you can use -D in all package managers and --dev (in everything but pnpm)
Example of code used in one of the packages I'm trying to upgrade because of this incompatibility
// bun use -d instead of -D, #90
Also I'd love to contribute this change + improve docs (and by docs I mean CLI usage docs that don't mention which flag is used for dev)
Current usage

Hmm I actually found a PR that implemented this #2240, but it was reverted 🤔 cc: @Jarred-Sumner
Hmm I actually found a PR that implemented this #2240, but it was reverted 🤔 cc: @Jarred-Sumner
It had to be reverted because it caused other issues with CLI parsing, we will revive the change soon.
Seems to be a duplicate of #1819, which is resolved.