Bun
Railpack supports Bun as a JavaScript runtime and package manager.
Detection
Section titled “Detection”Railpack selects Bun through JavaScript package manager detection. Bun is
selected when the packageManager field declares it, or when no
higher-priority package manager is configured and an engines.bun field,
bun.lock, or bun.lockb file exists.
Bun is also installed when a package script or configured start command invokes it.
Versions
Section titled “Versions”The Bun version can be configured using:
- The
RAILPACK_BUN_VERSIONenvironment variable - The
packageManagerfield inpackage.json, such as[email protected] - The
engines.bunfield inpackage.json - A
.bun-version,mise.toml, or.tool-versionsfile
The version defaults to latest when none is configured.
Node.js Compatibility
Section titled “Node.js Compatibility”Some Bun projects also require Node.js for Corepack, scripts, frameworks, or native module compilation. Railpack installs Node.js automatically when it is needed.
Bun applications otherwise use the same framework, monorepo, and SPA detection described in the Node.js documentation.