# Add a dependency (/docs/guides/install/add)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 179 · updated: 2026-07-28 -->
Related: [Add a development dependency](/docs/guides/install/add-dev.md), [Add an optional dependency](/docs/guides/install/add-optional.md), [Add a peer dependency](/docs/guides/install/add-peer.md), [Add a Git dependency](/docs/guides/install/add-git.md), [Add a tarball dependency](/docs/guides/install/add-tarball.md), [Install a package under a different name](/docs/guides/install/npm-alias.md)

To add an npm package as a dependency, use `bun add`.

```sh terminal icon="terminal"
bun add zod
```

***

This adds the package to `dependencies` in `package.json`. By default, Bun uses the `^` range specifier, which accepts future minor and patch versions.

```json package.json icon="file-json"
{
  "dependencies": {
    "zod": "^3.0.0" // [!code ++]
  }
}
```

***

To pin your project to the exact version you installed, use `--exact`. This adds the package to `dependencies` without the `^`.

```sh terminal icon="terminal"
bun add zod --exact
```

***

To specify an exact version or a tag:

```sh terminal icon="terminal"
bun add zod@3.0.0
bun add zod@next
```

***

See [`bun install`](/pm/cli/install).
