DEV Community 👩‍💻👨‍💻

Brent Vanwildemeersch
Brent Vanwildemeersch

Posted on

Bun command not found on Linux

After a clean install of bun on Linux, the bun command will not be recognised by the commandline, because bun was not automatically added to PATH

It will probably return a message as following,

bun --version

Command 'bun' not found, did you mean:

  command 'ben' from deb ben (0.9.0ubuntu2)
  command 'bus' from deb atm-tools (1:2.5.1-4)
  command 'zun' from deb python3-zunclient (4.0.0-0ubuntu1)

Try: sudo apt install <deb name>
Enter fullscreen mode Exit fullscreen mode

You can solve this with the following actions :

1. Edit the .bashrc file

nano nano ~/.bashrc 
Enter fullscreen mode Exit fullscreen mode

2. Add the following lines at the end of your .bashrc file

BUN_INSTALL="/home/{USERNAME}/.bun"
PATH="$BUN_INSTALL/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

with {USERNAME} replaced by your username.

3. Close your terminal and open a new shell

bun --version
Enter fullscreen mode Exit fullscreen mode

should now return information on the installed version of bun

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Good news! You can update to dark mode in your DEV settings.