* fix(win/upgrade): do not show powershell expand-archive info while upgrading * start working bun run * experiment: `bun.new` * you can now bun run * Update src/install/install.zig Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * Update src/install/install.zig Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * stuff * fix stuff * fix this * farther but not really * sadfs * path hell not sure how much worse or better this makes things. its a mess. windows path handlign is a mess aaaaaaaaaaaaaaaa * path.resolve bs * remove old build system stuff from pr * a * fix some path.parse/join cases * path closer not perfect * normalize and join tests tests done * paths * implement path.relative * , * stuff * assert * fix compile * hate * the code isnt great * stuff * housekeeping for build system * blah * explain windows sitaution in docs * some progress? not much though * zig compiler crashes here * fix * yippee * ok * a * ala wala * fix builds on stuff * clean * the tests now run * a * aa * dedupe uv event loop * fix fs test accuracy * stuff * [autofix.ci] apply automated fixes * huge updat e * [autofix.ci] apply automated fixes * url * [autofix.ci] apply automated fixes * start windows spawnSync * [autofix.ci] apply automated fixes * add --webkit for update submodules * add better err message for `bun setup` * fix unix platform build * . * [autofix.ci] apply automated fixes * un-upgrade libarchive * z * asdfghj * wrk * todo -> panic * ok * a * [autofix.ci] apply automated fixes * fix build scripts l ol * dfghj * fa * [autofix.ci] apply automated fixes * aaaa * a * l * [autofix.ci] apply automated fixes * more logs * [autofix.ci] apply automated fixes * j * fix init_command * CORE DUMP HELL * i swear im being pranked by the github actions gods * fadsjkfdshjkhjkdfsahjkdfshjksdafjkhhjkfdsahfsdkjhfsdjkahf * thanks IAS * this is the correct fix * personal review * ddisablbe these * revisions! * ok * fix submodule * stuff * fix libarchive * [autofix.ci] apply automated fixes * stuff * [autofix.ci] apply automated fixes * a * fix addressToJS on windows * make dns async again * dx: add flag to update submodules ps1 to clone webkit * dns error case for libuv * dx improvements on windows * newline * obvious fix * install steps * extra note * fix fs test * Update building-windows.md * fix builtins bundler to support \r\n line endnigs * better * some windows stuff * a * a * a * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * [autofix.ci] apply automated fixes * bunfile text works * fix build on the mac * hellooooooooooo * install steps * ci for baseline? * fix * aaa * wow * install script revamp * bug * OK * ok * aaaaaaaaaaaaaa * okay * fix the node test runner lol * fix napi stuff --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciai@gmail.com> Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
5.3 KiB
Bun ships as a single executable that can be installed a few different ways.
Installing
macOS and Linux
{% callout %}
Linux users — The unzip package is required to install Bun. Use sudo apt install unzip to install unzip package.
Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Use uname -r to check Kernel version.
{% /callout %}
{% codetabs %}
$ curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
# to install a specific version
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
$ npm install -g bun # the last `npm` command you'll ever need
$ brew tap oven-sh/bun # for macOS and Linux
$ brew install bun
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
$ proto install bun
{% /codetabs %}
Windows
Bun provides a limited, experimental native build for Windows. It is recommended to use Bun within Windows Subsystem for Linux and follow the above instructions.
To install, paste this into your terminal (Powershell or cmd.exe):
# WARNING: No stability is guaranteed on the experimental Windows builds
powershell -c "iwr bun.sh/install.ps1|iex" -ExecutionPolicy RemoteSigned
For support and discussion, please join the #windows channel on our Discord.
Docker
Bun provides a Docker image that supports both Linux x64 and arm64.
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
There are also image variants for different operating systems.
$ docker pull oven/bun:debian
$ docker pull oven/bun:slim
$ docker pull oven/bun:alpine
$ docker pull oven/bun:distroless
Checking installation
To check that Bun was installed successfully, open a new terminal window and run bun --version.
$ bun --version
1.x.y
To see the precise commit of oven-sh/bun that you're using, run bun --revision.
$ bun --revision
1.x.y+b7982ac13189
If you've installed Bun but are seeing a command not found error, you may have to manually add the installation directory (~/.bun/bin) to your PATH.
{% details summary="How to add to your PATH" %}
First, determine what shell you're using:
$ echo $SHELL
/bin/zsh # or /bin/bash or /bin/fish
Then add these lines below to bottom of your shell's configuration file.
{% codetabs %}
# add to ~/.zshrc
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# add to ~/.bashrc
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# add to ~/.config/fish/config.fish
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
{% /codetabs %} Save the file. You'll need to open a new shell/terminal window for the changes to take effect.
{% /details %}
Upgrading
Once installed, the binary can upgrade itself.
$ bun upgrade
{% callout %}
Homebrew users — To avoid conflicts with Homebrew, use brew upgrade bun instead.
proto users - Use proto install bun --pin instead.
{% /callout %}
Bun automatically releases an (untested) canary build on every commit to main. To upgrade to the latest canary build:
$ bun upgrade --canary
{% callout %}
Note — To switch back to a stable release from canary, run bun upgrade again with no flags.
{% /callout %}
Uninstall
If you need to remove Bun from your system, use the following commands.
{% codetabs %}
$ rm -rf ~/.bun # for macOS, Linux, and WSL
$ npm uninstall -g bun
$ brew uninstall bun
$ proto uninstall bun
{% /codetabs %}