Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global install doesn't place commands in PATH #18

Closed
doubledup opened this issue Nov 6, 2023 · 7 comments
Closed

Global install doesn't place commands in PATH #18

doubledup opened this issue Nov 6, 2023 · 7 comments

Comments

@doubledup
Copy link

From the docs, bun install --global cowsay should make cowsay available. Instead I get fish: Unknown command: cowsay, even after asdf reshim and starting a new shell.

This is in fish shell 3.6.1, kitty 0.30.1 and macOS 14.1. The same error occurs in the default Terminal 2.14 (452), and in bash 5.2.15(1)-release (aarch64-apple-darwin22.1.0) and zsh 5.9 (x86_64-apple-darwin23.0). Combinations of Terminal with bash & zsh also produce this error.

@cometkim
Copy link
Owner

cometkim commented Nov 6, 2023

Yep, I never implemented that feature. but has a plan to support it as described in #14 (comment)

@doubledup
Copy link
Author

Thanks! 🙏

Looks like the only thing missing for this is the shell rc file edits made by the bun install script. You mentioned this in the linked comment: "... users have to manually configure the PATH."

A workaround for anyone running into this is to run the bun install script to get the changes to your shell rc file:

asdf plugin remove bun
curl -fsSL https://bun.sh/install | bash
rm -rf ~/.bun/
asdf plugin add bun

The uninstall step comes from the uninstall issue in bun.

@cometkim
Copy link
Owner

cometkim commented Nov 6, 2023

@doubledup Just add ~/.bun/bin to your PATH then you can use globally installed binaries

@cometkim
Copy link
Owner

cometkim commented Nov 6, 2023

And even you can customize your global installation path, see https://bun.sh/docs/runtime/bunfig#install-globalbindir

@cometkim
Copy link
Owner

cometkim commented Nov 6, 2023

However, I've changed my mind, I think it's not a role of this asdf plugin.

I think the current behavior of Bun is not suitable for managing global installations. See https://gist.github.com/cometkim/eb2842d67b40e583e4886e9b897a6af0

Maybe you can request the upstream to change its behavior to be more sensible

@cometkim
Copy link
Owner

cometkim commented Nov 6, 2023

just filed a ticket to upstream oven-sh/bun#6928

@cometkim
Copy link
Owner

Bun has the problem of not being well suited to handle global installations (See oven-sh/bun#6928)

I could override the behavior like the asdf-nodejs plugin does for npm, but I believe that's not the correct move. I would not recommend managing global installations via Bun until this is discussed upstream.

@cometkim cometkim closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
cometkim added a commit that referenced this issue Nov 12, 2023
as a description of a decision made from #13 and #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants