---
title: Bun v1.0.17
description: "Fixes 15 bugs (addressing 152 👍 reactions). bun install postinstall scripts run for top 500 packages, `bunx supabase` starts 30x faster than `npx supabase`, `bunx esbuild` starts 50x faster than `npx esbuild` and bugfixes to bun install"
date: "2023-12-12T11:36:17.645Z"
author: jarred
draft: false
---

Bun v1.0.17 fixes 15 bugs (addressing 152 👍 reactions). `bun install` postinstall scripts run for top 500 packages, `bunx supabase` starts 30x faster than `npx supabase`, `bunx esbuild` starts 50x faster than `npx esbuild` and bugfixes to bun install

Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager &mdash; all in one. In case you missed it, here are some of the recent changes to Bun:

- [`v1.0.13`](/blog/bun-v1.0.13) - Fixes 6 bugs (addressing 317 👍 reactions). 'http2' module & gRPC.js work now. Vite 5 & Rollup 4 work. Implements process.report.getReport(), improves support for ES5 'with' statements, fixes a regression in bun install, fixes a crash when printing exceptions, fixes a Bun.spawn bug, and fixes a peer dependencies bug
- [`v1.0.14`](/blog/bun-v1.0.14) - `Bun.Glob`, a fast API for matching files and strings using glob patterns. It also fixes a race condition when extracting dependencies during `bun install`, improves TypeScript module resolution in `node_modules`, and makes error messages easier to read.
- [`v1.0.15`](/blog/bun-v1.0.15) - Fixes 23 bugs (addressing 117 👍 reactions), `tsc` starts 2x faster. Stable `WebSocket` client, syntax-highlighted errors, cleaner stack traces, add custom test matchers with `expect.extend()` + additional expect matchers.
- [`v1.0.16`](/blog/bun-v1.0.16) - Fixes 49 bugs (addressing 38 👍 reactions). Concurrent IO for Bun.file & Bun.write gets 3x faster and now supports Google Cloud Run & Vercel, Bun.write auto-creates the parent directory if it doesn't exist, `expect.extend` inside of preload works, `napi_create_object` gets 2.5x faster, bugfix for module resolution impacting Astro v4 and p-limit, console.log bugfixes

To install Bun:

{% codetabs %}

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

```sh#npm
$ npm install -g bun
```

```sh#brew
$ brew tap oven-sh/bun
$ brew install bun
```

```sh#docker
$ docker pull oven/bun
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
```

{% /codetabs %}

To upgrade Bun:

```sh
$ bun upgrade
```

## bun install now runs lifecycle scripts for the top 500 npm packages

In this release, we've added the top 500 most-downloaded npm packages in [a default allowlist](https://github.com/oven-sh/bun/blob/bun-v1.0.17/src/install/default-trusted-dependencies.txt#L1-L500) to run lifecycle scripts during `bun install`. This means that `bun install` will now run `preinstall`, `install`, and `postinstall` scripts for the top 500 npm packages which have them defined.

This addresses _many_ issues with `bun install`:

{% image width=200 src="https://github.com/oven-sh/bun/assets/709451/b66c452b-002e-4250-9ad4-f8b8c82e533f" /%}

Thanks to [@dylan-conway](https://github.com/dylan-conway) and @paperclover for implementing this.

### Lifecycle scripts now run in parallel

As part of the above work, we also made lifecycle scripts run in parallel, which reduces the impact of lifecycle scripts on installation time.

{% image width="75%" src="https://github.com/oven-sh/bun/assets/709451/4ad72f2f-6152-4e4e-b1d1-d832cefdd8f8" alt="image" caption="⚙️ emoji appears when the lifecycle script is running" /%}

#### Configuring concurency

You can configure the maximum number of concurrent lifecycle scripts that run at once either by

`bunfig.toml`:

```toml
# Only run 5 in parallel at max
install.concurrentScripts = 5
```

CLI argument:

```sh
$ bun install --concurrent-scripts=5
```

Environment variable:

```sh
$ GOMAXPROCS=2 bun install
```

Note: it is `$GOMAXPROCS` because we use that elsewhere and it's one less environment variable for us to make up a name for (it's what Go uses, but Bun doesn't use Go).

## Error message improvement in bun install

When a permissions error occurs, bun install now shows a more helpful error message. Instead of just "Unexpected", it now provides more information when it can.

{% image src="https://github.com/oven-sh/bun/assets/24465214/26e2f264-d468-4785-a48b-1be84188e4bd" caption="Left: before, Right: after" /%}

Thanks to [@paperclover](https://github.com/paperclover) for implementing this.

### Fixed: Semver pre-release sorting bug

A crash that could occur when sorting many pre-release versions of specific input simultaneously has been fixed. This bug was fixed by [@dylan-conway](https://github.com/dylan-conway). This bug could be reproduced when installing 4 year old versions of Gatsby.

### Fixed: lifecycle script dependency install order

A bug where `bun install` would install lifecycle scripts without first ensuring all dependent lifecycle scripts were installed has been fixed. This bug was fixed by [@dylan-conway](https://github.com/dylan-conway).

## `bunx supabase` starts 30x faster than `npx supabase`

Since `bun install` now enables lifecycle scripts for popular packages by default, `bunx supabase` now works.

On Linux x64, `bun x supabase` starts 30x faster than `npx supabase`:

```rust
Benchmark 1: bun x supabase
  Time (mean ± σ):      10.5 ms ±   1.0 ms    [User: 8.0 ms, System: 5.5 ms]
  Range (min … max):     8.5 ms …  13.1 ms    248 runs

Benchmark 2: npx supabase
  Time (mean ± σ):     325.2 ms ±  30.6 ms    [User: 272.6 ms, System: 117.9 ms]
  Range (min … max):   291.0 ms … 389.9 ms    10 runs

Summary
  bun x supabase ran
   30.90 ± 4.17 times faster than npx supabase
```

## `bunx esbuild` starts 50x faster than `npx esbuild`

Now that `bun install` enables lifecycle scripts for popular packages by default, `bunx esbuild` now starts roughly 50x faster than `npx esbuild`:

```rust
Benchmark 1: bun x esbuild --help
  Time (mean ± σ):       3.5 ms ±   0.3 ms    [User: 1.8 ms, System: 1.6 ms]
  Range (min … max):     2.8 ms …   4.3 ms    827 runs

Benchmark 2: npx esbuild --help
  Time (mean ± σ):     295.7 ms ±  23.8 ms    [User: 270.0 ms, System: 100.6 ms]
  Range (min … max):   259.6 ms … 339.6 ms    10 runs

Summary
  bun x esbuild --help ran
   83.84 ± 9.31 times faster than npx esbuild --help
```

## `-h` is now an alias of `--help`

`-h` is now an alias of `--help` for all commands. Thanks to [@hustLer2k](https://github.com/hustLer2k) for implementing this.

```shell
$ bun -h

Bun is a fast JavaScript runtime, package manager, bundler, and test runner. (1.0.16 (a2f595d3))

Usage: bun <command> [...flags] [...args]

Commands:
  run       ./my-script.ts       Execute a file with Bun
            lint                 Run a package.json script
  test                           Run unit tests with Bun
  x         vite                 Execute a package binary (CLI), installing if needed (bunx)
  repl                           Start a REPL session with Bun

  install                        Install dependencies for a package.json (bun i)
  add       svelte               Add a dependency to package.json (bun a)
  remove    babel-core           Remove a dependency from package.json (bun rm)
  update    lodash               Update outdated dependencies
  link      [<package>]          Register or link a local npm package
  unlink                         Unregister a local npm package
  pm <subcommand>                Additional package management utilities

  build     ./a.ts ./b.jsx       Bundle TypeScript & JavaScript into a single file

  init                           Start an empty Bun project from a blank template
  create                         Create a new project from a template (bun c)
  upgrade                        Upgrade to latest version of Bun.
  <command> --help               Print help text for command.

Flags:
      --watch                    Automatically restart the process on file change
      --hot                      Enable auto reload in the Bun runtime, test runner, or bundler
      --smol                     Use less memory, but run garbage collection more often
  -r, --preload                  Import a module before other modules are loaded
      --inspect                  Activate Bun's debugger
      --inspect-wait             Activate Bun's debugger, wait for a connection before executing
      --inspect-brk              Activate Bun's debugger, set breakpoint on first line of code and wait
      --if-present               Exit without an error if the entrypoint does not exist
      --no-install               Disable auto install in the Bun runtime
      --install                  Configure auto-install behavior. One of "auto" (default, auto-installs when no node_modules), "fallback" (missing packages only), "force" (always).
  -i                             Auto-install dependencies during execution. Equivalent to --install=fallback.
  -e, --eval                     Evaluate argument as a script
      --prefer-offline           Skip staleness checks for packages in the Bun runtime and resolve from disk
      --prefer-latest            Use the latest matching versions of packages in the Bun runtime, always checking npm
  -p, --port                     Set the default port for Bun.serve
  -b, --bun                      Force a script or package to use Bun's runtime instead of Node.js (via symlinking node)
      --silent                   Don't print the script command
  -v, --version                  Print version and exit
      --revision                 Print version with revision and exit
      --env-file                 Load environment variables from the specified file(s)
      --cwd                      Absolute path to resolve files & entry points from. This just changes the process' cwd.
  -c, --config                   Specify path to Bun config file. Default $cwd/bunfig.toml
  -h, --help                     Display this menu and exit

(more flags in bun install --help, bun test --help, and bun build --help)

Learn more about Bun:            https://bun.sh/docs
Join our Discord community:      https://bun.sh/discord
```

## Fixed: encoding argument in fs.createReadStream

A bug where the `encoding` argument in `fs.createReadStream` was not handled correctly has been fixed. This bug was fixed by [@hustLer2k](https://github.com/hustLer2k).

## Thanks to 6 contributors!

- [@DaleSeo](https://github.com/DaleSeo)
- [@dylan-conway](https://github.com/dylan-conway)
- [@hustLer2k](https://github.com/hustLer2k)
- [@Jarred-Sumner](https://github.com/Jarred-Sumner)
- [@NReilingh](https://github.com/NReilingh)
- [@paperclover](https://github.com/paperclover)
