Skip to content

How to Install Bun on Windows - Multiple Ways

Published: at 07:43 AM

Table of contents

Open Table of contents

How to Install Bun on Windows: Multiple Ways

Bun is an incredibly fast all-in-one JavaScript runtime, bundler, transpiler, and package manager. If you’re developing web applications or working with modern JavaScript/TypeScript projects, Bun can speed up your workflow. In this post, we’ll explore several ways to install Bun on Windows, including using npm, curl, Scoop, and more.


1. Installing Bun via npm

If you already have Node.js installed on your system, installing Bun via npm is straightforward.

npm install -g bun

After the installation completes, you can verify that Bun is installed correctly by running:

bun --version

Advantages:

Disadvantages:


2. Installing Bun using curl

Bun’s official installation script can be executed using curl to download and set it up.

curl -fsSL https://bun.sh/install | bash

This command downloads and runs Bun’s installation script, which handles everything for you.

After installation, add Bun to your PATH by adding the following to your profile file (.bashrc, .zshrc, or .profile depending on your shell):

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

Once done, verify the installation by running:

bun --version

Advantages:

Disadvantages:


3. Installing Bun with Scoop

Scoop is a popular command-line installer for Windows. If you don’t have Scoop installed, first install it by running:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex

Once Scoop is installed, you can install Bun with:

scoop install bun

Verify the installation:

bun --version

Advantages:

Disadvantages:


4. Installing Bun with Chocolatey

Chocolatey is another popular Windows package manager. To install Bun using Chocolatey, run:

choco install bun

After the installation, confirm Bun is working:

bun --version

Advantages:

Disadvantages:


5. Installing Bun via GitHub Releases

If you prefer manual installation or want a specific version of Bun, you can download pre-built binaries from the Bun GitHub Releases.

Steps:

  1. Download the latest Windows release.
  2. Extract the binary to a folder.
  3. Add the folder to your system PATH.
  4. Verify the installation:
    bun --version
    

Advantages:

Disadvantages:


Conclusion

Bun is a powerful tool for JavaScript and TypeScript developers, and installing it on Windows is easy with several options to suit different preferences. Whether you prefer using npm, curl, Scoop, Chocolatey, or downloading directly from GitHub, this guide has you covered.

Happy coding with Bun!


Next Post
State Management in Svelte.js - A Reactive Approach