Skip to content

Make binary intsallation behavior more sensible #6928

@cometkim

Description

@cometkim

What version of Bun is running?

1.0.9

What platform is your computer?

Linux 6.2.0-36-generic x86_64 x86_64

What steps can reproduce the bug?

bun add vite

# expect this to be failed
bun esbuild --version

bun remove vite

# expect this to be failed
bun esbuild --version

Do same test for global

What is the expected behavior?

Vite package has the vite binary in its manifest, and 3 other binaries esbuild, rollup, nanoid from its transitive dependencies.

Users expect only vite command available after installation, especially when it is for global installation.

What do you see instead?

Bun installs all binaries from transitive dependencies. So vite, esbuild, rollup, nanoid commands are available.

And even Bun doesn't cleanup transitive binaries after uninstalling vite, so even after uninstallation esbuild, rollup, nanoid commands are available. The only option for cleanup is to remove and regenerate node_modules, and this is not possible for global installation.

Additional information

https://gist.github.com/cometkim/eb2842d67b40e583e4886e9b897a6af0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbun installSomething that relates to the npm-compatible client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions