2026-01-06 19:56:22 +00:00
---
2026-01-16 22:41:49 +00:00
summary: "Bun workflow (experimental): installs and gotchas vs pnpm"
2026-01-06 19:56:22 +00:00
read_when:
- You want the fastest local dev loop (bun + watch)
- You hit Bun install/patch/lifecycle script issues
2026-01-31 16:04:03 -05:00
title: "Bun (Experimental)"
2026-01-06 19:56:22 +00:00
---
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
# Bun (Experimental)
2026-01-06 19:56:22 +00:00
2026-03-19 12:05:23 -07:00
< Warning >
Bun is **not recommended for gateway runtime** (known issues with WhatsApp and Telegram). Use Node for production.
< / Warning >
2026-01-13 07:58:47 +00:00
2026-03-19 12:05:23 -07:00
Bun is an optional local runtime for running TypeScript directly (`bun run ...` , `bun --watch ...` ). The default package manager remains `pnpm` , which is fully supported and used by docs tooling. Bun cannot use `pnpm-lock.yaml` and will ignore it.
2026-01-06 03:30:33 +01:00
2026-01-06 19:56:22 +00:00
## Install
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
< Steps >
< Step title = "Install dependencies" >
```sh
bun install
```
2026-01-06 19:56:22 +00:00
2026-03-19 12:05:23 -07:00
`bun.lock` / `bun.lockb` are gitignored, so there is no repo churn. To skip lockfile writes entirely:
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
```sh
bun install --no-save
```
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
< / Step >
< Step title = "Build and test" >
```sh
bun run build
bun run vitest run
```
< / Step >
< / Steps >
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
## Lifecycle Scripts
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
Bun blocks dependency lifecycle scripts unless explicitly trusted. For this repo, the commonly blocked scripts are not required:
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
- `@whiskeysockets/baileys` `preinstall` -- checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node 22 LTS, currently `22.16+` )
- `protobufjs` `postinstall` -- emits warnings about incompatible version schemes (no build artifacts)
2026-01-06 03:30:33 +01:00
2026-03-19 12:05:23 -07:00
If you hit a runtime issue that requires these scripts, trust them explicitly:
2026-01-06 03:30:33 +01:00
```sh
bun pm trust @whiskeysockets/baileys protobufjs
```
## Caveats
2026-03-19 12:05:23 -07:00
Some scripts still hardcode pnpm (for example `docs:build` , `ui:*` , `protocol:check` ). Run those via pnpm for now.