DEV Community

Oleg
Oleg

Posted on

1

zsh: command not found: bun

Hello, my fellow readers!
When I first tried to set up bun I expected that Bun would work from any location on my disk. However, I encountered zsh: command not found when I tried running bun command from my repository.

The next second, I googled this error and found what seems to be the most-viewed topic on the matter here stackoverflow.
People suggest fixing this issue by adding in .bashrc file such code

export BUN_INSTALL="/home/YOUR_USERNAME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Unfortunately, this didn't work on my Mac and I realized that .bashrc is for Linux OS and working solution in my case is:

  1. Go to /Users/{your username}
  2. Create .zshrc file if it doesn’t already exist
  3. Add the following code to the .zshrc file
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

I hope this information is helpful to someone!

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay