2

First, I run this command on my windows machine

 $curl https://bun.sh/install | bash

Output of the above first command

Output of the above first command

Second, I run this command to set this path in the file

$nano ~/.bashrc

Output of the above second command

Output of the above second command

After setting these variables into the ~/.bashrc file. I am trying to check the version of Bun which is just installed, with this command :

$bun --version

After running the above command I got this output :

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: apt install <deb name>

Can anyone please help me to activate Bun smoothly on my windows machine?

NotTheDr01ds
  • 15,620
  • 5
  • 44
  • 70
  • Also, for future reference, please don't post text-as-images. Read [here](https://meta.stackoverflow.com/a/285557/11810933) for why. Thanks! – NotTheDr01ds Jul 11 '22 at 12:59

3 Answers3

2

I can tell you that I have successfully installed Bun in Ubuntu 20.04 on WSL2. However, note that it will not currently run in WSL1 (from the Unix & Linux Stack). That's not the error you are seeing here, however.

Apologies in advance if this is not the case, but given that you are new here, I'm going to make an assumption that it might be something very basic that is causing the error you are seeing. The output of the first command indicates that Bun was installed properly, so if it's not found, it seems most likely that you missed one crucial step. You also didn't state that you did it, so ...

~/.bashrc is a file that is typically only read when you start Bash. After adding the variables to your ~/.bashrc, to have it actually set the variables in a shell session, you need to either:

  • source ~/.bashrc`
  • Or simply start a new shell (exit WSL and restart, or just run another bash inside bash, etc.

Of course, after doing this, you'll still need to be running WSL2, or you'll run into the other error.

Note that, beyond simply creating a project, I have not tested Bun extensively in WSL2. The Fireship-guy on YouTube did mention that he had some challenges in getting it to run under WSL, but I'm not sure what those were.

NotTheDr01ds
  • 15,620
  • 5
  • 44
  • 70
0

I've present the same problem. Context sotware=> I use win 11 and I've download ubuntu

microsoft store

For this, I enable in feactures windows turn on and off feactures

and clink here these options

For download bun 0.1.8

I've execute this command curl -fsSL https://bun.sh/install | bash

late, at the console say that i have to put 2 line of code in a file in my case are :

export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

When, I tried execute bun --version the console showed that did't find bun.

I restart the windows and it seems to have worked

0

I found answers in the post https://stackoverflow.com/a/73097326/5072481 add username path to $HOME/ is the point

sema toghem
  • 77
  • 1
  • 4
  • Needed to write with all lowercase to make it recognized `export BUN_INSTALL="/home/administrator/.bun" export PATH="$BUN_INSTALL/bin:$PATH"` – Bitfinicon Nov 27 '22 at 18:15