---
title: Use pnpm, Yarn, or bun
description: Use pnpm, Yarn, or bun instead of npm for your Capawesome Cloud native builds by setting dependencyInstallCommand in capawesome.config.json.
---

# Use pnpm, Yarn, or bun

By default, Capawesome Cloud installs dependencies with `npm install` and builds web assets with `npm run build`. If your project uses pnpm or Yarn instead, override these two steps with the `dependencyInstallCommand` and `webBuildCommand` options in a [`capawesome.config.json`](configuration.md) file.

The [build environment](build-stacks.md) already ships with Node.js, npm, pnpm, Yarn, and bun — so there's no need to install your package manager first. Just call it directly.

!!! warning "Don't reinstall a pre-installed package manager"

    Reaching for `npm install -g pnpm` breaks the build, because the binary already exists:

    ```
    npm error code EEXIST
    npm error path .../bin/pnpm
    npm error EEXIST: file already exists
    ```

## pnpm

Install dependencies and build with pnpm:

```json title="capawesome.config.json"
{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id",
                "dependencyInstallCommand": "pnpm install --frozen-lockfile",
                "webBuildCommand": "pnpm build"
            }
        ]
    }
}
```

## Yarn

The same approach works for Yarn:

```json title="capawesome.config.json"
{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id",
                "dependencyInstallCommand": "yarn install --immutable",
                "webBuildCommand": "yarn build"
            }
        ]
    }
}
```

## bun

bun works the same way — install dependencies and build:

```json title="capawesome.config.json"
{
    "cloud": {
        "apps": [
            {
                "appId": "your-app-id",
                "dependencyInstallCommand": "bun install --frozen-lockfile",
                "webBuildCommand": "bun run build"
            }
        ]
    }
}
```

## Pin the version with Corepack

The pre-installed pnpm and Yarn versions can drift from the version your team uses locally. To lock the build to a specific version, add a `packageManager` field to your `package.json`:

```json title="package.json"
{
    "packageManager": "pnpm@9.12.0"
}
```

[Corepack](https://nodejs.org/api/corepack.html){:target="_blank"} is already enabled in the build environment, so your existing `pnpm install` command automatically picks up the version declared here — no change to `capawesome.config.json` needed.

!!! tip "Install from the lockfile"

    The examples above use `--frozen-lockfile` (pnpm) and `--immutable` (Yarn) so the Cloud installs the exact versions in your lockfile and fails if it's out of date — the same reproducibility you'd want in any CI pipeline.

## Next steps

- [App Configuration](configuration.md) — the full `capawesome.config.json` schema.
- [Build from a monorepo](monorepo.md) — for pnpm or Yarn workspaces.
- [Configure the web build script](web-build-script.md) — control which script builds your web assets.
