# lpm use (/docs/dev/use)



```bash
lpm use <runtime>@<version>      # install + pin
lpm use --list [runtime]         # list installed versions
lpm use remove <runtime>@<spec>  # remove installed versions matching a spec
```

Installs and pins managed runtimes under `~/.lpm/runtimes/`. Supported runtimes are `node` and `bun`.

After `lpm use node@22`, scripts run with the pinned Node version via PATH injection. After `lpm use bun@1.3.14`, scripts can call `bun` from the managed Bun install. `runtime.bun` does **not** make LPM CLI execute scripts through `bun run`; `lpm run` still uses LPM CLI's runner and exposes Bun on `PATH`.

For project environment variables and secrets management, see [`lpm env`](/docs/dev/env).

## Installing Node [#installing-node]

```bash
lpm use node@22                # install + pin Node 22 (resolves to latest 22.x)
lpm use node@lts               # install + pin the latest LTS
lpm use node@22.12.0           # install + pin an exact version
lpm use node@22 --pin          # already installed — pin the concrete version, no download
```

Versions land under `~/.lpm/runtimes/node/`. `lpm use node@22` resolves the spec, downloads the build for your platform if missing, then writes the pin to `lpm.json`:

```json title="lpm.json"
{ "runtime": { "node": "22.12.0" } }
```

When `lpm.json > runtime.node` is absent, detection falls back through `package.json > engines.node`, then `.nvmrc`, then `.node-version`. See [Managed runtimes](/docs/dev/node-version-pinning) for the full ladder.

## Installing Bun [#installing-bun]

```bash
lpm use bun@1.3.14             # install + pin an exact Bun version
lpm use bun@latest             # install + pin the latest Bun release
lpm use bun@1.3 --pin          # pin a matching installed 1.3.x version
```

Versions land under `~/.lpm/runtimes/bun/`. `lpm use bun@1.3.14` writes:

```json title="lpm.json"
{ "runtime": { "bun": "1.3.14" } }
```

Bun specs accept exact versions, `v1.3.14`, `bun-v1.3.14`, `latest`, major/minor prefixes, and semver ranges. Bun does not have an LTS channel, so `bun@lts` is rejected.

`runtime.bun` is read only from `lpm.json`. `package.json > engines.bun` is surfaced as a compatibility warning but is not enforced.

## Listing Installed Versions [#listing-installed-versions]

```bash
lpm use --list                 # list installed Node versions
lpm use --list node            # same
lpm use --list bun             # list installed Bun versions
```

With `--json`, the envelope includes the selected runtime:

```json
{ "success": true, "runtime": "bun", "versions": ["1.3.14"] }
```

## Removing Installed Versions [#removing-installed-versions]

```bash
lpm use remove node@20         # remove all installed 20.x Node runtimes
lpm use remove bun@1.3         # remove all installed 1.3.x Bun runtimes
lpm use remove bun@1.3.14      # remove one exact Bun runtime
```

Removal matches the local managed runtime set only. Exact versions remove one installed runtime. Prefixes and semver ranges remove every installed version that satisfies the spec.

`lpm use remove` accepts explicit versions, prefixes, and semver ranges. It does not accept `node@lts`, `node@latest`, `bun@lts`, or `bun@latest` because removal must be deterministic against the local install set.

Removing a managed runtime does **not** rewrite `lpm.json`. If the project still pins a matching runtime, LPM CLI warns because the next `lpm run` / `lpm dev` / `lpm install` path that needs that pin can auto-install it again.

## Flags [#flags]

| Flag       | Effect                                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `--list`   | List installed versions for the runtime                                                                                       |
| `--pin`    | Pin only. Exactizes to an installed version when one already matches; otherwise stores the requested spec without downloading |
| `--remove` | Remove installed managed runtimes matching a spec. `lpm use remove bun@1.3` is the preferred explicit command form.           |

Plus the [global flags](/docs/commands#global-flags).

## See Also [#see-also]

* [`lpm env`](/docs/dev/env) — project environment variables and secrets
* [`lpm dev`](/docs/dev/dev) — picks up runtime pins automatically
* [Managed runtimes](/docs/dev/node-version-pinning) — how pins propagate to scripts
