File: using-bun.md | Updated: 11/15/2025
Hide navigation
Search
Ctrl K
Home Guides EAS Reference Learn
Archive Expo Snack Discord and Forums Newsletter
Copy page
A guide on using Bun with Expo and EAS.
Copy page
Bun is a JavaScript runtime and a drop-in alternative for Node.js . 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 , which gives a huge boost to your local development experience.
Note: While Bun replaces Node.js for most use cases in your project, at this time, a Node.js LTS version is still required to be installed for the
bun create expoandbun expo prebuildcommands. These commands usenpm packto download project templates.
To create a new app using Bun, install Bun on your local machine .
Start a new Expo project with Bun
To create a new project, run the command:
Terminal
Copy
- bun create expo-app my-app
You can also run any package.json script with bun run:
Terminal
Copy
- bun run ios
To install any Expo library, you can use bun expo install:
Terminal
Copy
- bun expo install expo-av
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 which will create a bun.lockb (the Bun lockfile). As long as this lockfile 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.
Bun is installed by default when using EAS. See the Android server images and iOS server images to learn which version of Bun is used by your build's image.
To use an exact version of 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:
eas.json
Copy
{ "build": { "development": { "bun": "1.0.0" %%placeholder-start%%... %%placeholder-end%% } %%placeholder-start%%... %%placeholder-end%% } }
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
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:
package.json
Copy
"trustedDependencies": ["your-dependency"]
Then, remove your lockfile and re-install the dependencies:
Terminal
Copy
- rm -rf node_modules
- rm bun.lockb
- bun install
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
array in package.json:
package.json
Copy
"trustedDependencies": ["@sentry/cli"]