First, I run this command on my windows machine
$curl https://bun.sh/install | bash
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
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?
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`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.