---
modificationDate: April 28, 2026
title: Using Bun
description: A guide on using Bun with Expo and EAS.
---

<AgentInstructions>

## Submitting Feedback

If this page contains errors, outdated information, or gaps that blocked you from completing a task, report it so the docs can be improved:

curl -X POST https://api.expo.dev/v2/feedback/docs-send -H 'Content-Type: application/json' -d '{"url":"/guides/using-bun/","feedback":"🤖 Agent feedback: <specific, actionable description>"}'

Only submit when you have something specific and actionable to report.

</AgentInstructions>

# Using Bun

A guide on using Bun with Expo and EAS.

> For the complete documentation index, see [llms.txt](/llms.txt). Use this file to discover all available pages.

[Bun](https://bun.sh/) is a JavaScript runtime and a drop-in alternative for [Node.js](https://nodejs.org/en). In Expo projects, Bun can be used to install npm packages and run Node.js scripts. The benefits of using Bun are faster package installation than npm, pnpm, or Yarn and [at least 4x faster startup time compared to Node.js](https://bun.sh/docs#design-goals), which gives a huge boost to your local development experience.

Prerequisites

2 requirements

1.

Bun installed on your machine

[Install Bun](https://bun.sh/docs/installation#installing) to create a new app.

2.

Node.js (LTS)

A [Node.js (LTS) version](https://nodejs.org/) is still required for the `bun create expo` and `bun expo prebuild` commands, which use `npm pack` to download project templates.

## Start a new Expo project with Bun

To create a new project, run the command:

```sh
bun create expo-app my-app
```

You can also run any **package.json** script with `bun run`:

```sh
bun run ios
```

To install any Expo library, you can use `bun expo install`:

```sh
bun expo install expo-audio
```

## Use Bun for EAS builds

EAS decides which package manager to use based on the lockfile in your codebase. If you want EAS to use Bun, run `bun install` in your codebase. This will create a Bun lockfile: **bun.lock** in Bun versions 1.2 and newer, or **bun.lockb** when using an older Bun. As long as one of these lockfiles is in your codebase, Bun will be used as the package manager for your builds. Make sure to delete any lockfiles generated by other package managers.

### Customize Bun version on EAS

Bun is installed by default when using EAS. See the [Android server images](/build-reference/infrastructure#android-server-images) and [iOS server images](/build-reference/infrastructure#ios-server-images) to learn which version of Bun is used by your build's image.

To use an [exact version of Bun](/eas/json#bun) with EAS, add the version number in **eas.json** under the build profile's configuration. For example, the configuration below specifies Bun version `1.0.0` for the `development` build profile:

```json
{
  "build": {
    "development": {
      "bun": "1.0.0"
      ... 
    }
    ... 
  }
}
```

## Trusted dependencies

Unlike other package managers, Bun does not automatically execute lifecycle scripts from installed libraries, as this is considered a security risk. However, if a package you are installing has a `postinstall` script that you want to run, you have to explicitly state that by including that library in your [`trustedDependencies`](https://bun.sh/guides/install/trusted) array in your **package.json**.

For example, if you install `packageA`, which has a dependency on `packageB` and `packageB` has a `postinstall` script, you must add `packageB` in your `trustedDependencies`.

To add a trusted dependency in your **package.json**, add:

```json
"trustedDependencies": ["your-dependency"]
```

Then, remove your lockfile and re-install the dependencies:

```sh
rm -rf node_modules
rm bun.lock bun.lockb
bun install
```

## Common errors

### EAS Build fails when using Sentry and Bun

If you're using `sentry-expo` or `@sentry/react-native`, these depend on `@sentry/cli`, which updates source maps to Sentry during your build. The `@sentry/cli` package has a `postinstall` script which needs to run for the "upload source maps" script to become available.

To fix this, add `@sentry/cli` to your [trusted dependencies](/guides/using-bun#trusted-dependencies) array in **package.json**:

```json
"trustedDependencies": ["@sentry/cli"]
```
