Skip to content

How to Install Bun

sametcn99 edited this page Feb 15, 2025 · 1 revision

How to Install Bun

Bun is an all-in-one JavaScript runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager.

Installation Methods

Global NPM Installation

npm install -g bun

Direct Installation (Unix-like Systems)

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

Windows Installation

Currently, Bun has experimental Windows support. For the best experience:

  1. Install Windows Subsystem for Linux (WSL)
  2. Install Bun within WSL using the curl command above

Verifying Installation

After installation, verify Bun is properly installed:

bun --version

Getting Started

  1. Initialize a new project:

    bun init
  2. Run a JavaScript file:

    bun run index.js
  3. Install dependencies:

    bun install

Additional Resources