Files
bun-src/docs/guides/install/custom-registry.mdx
T
2026-08-27 21:09:14 +00:00

33 lines
1.0 KiB
Plaintext

---
title: Override the default npm registry for bun install
sidebarTitle: Override the default npm registry
mode: center
---
The default registry is `registry.npmjs.org`. Override it globally in `bunfig.toml`.
```toml bunfig.toml icon="settings"
[install]
# set default registry as a string
registry = "https://registry.npmjs.org"
# if needed, set a token
# registry = { url = "https://registry.npmjs.org", token = "123456" }
# if needed, set a username/password
# registry = "https://username:[email protected]"
```
---
Your `bunfig.toml` can reference environment variables. `bun install` automatically loads environment variables from `.env.production.local`, `.env.local`, `.env.production`, and `.env`, regardless of `NODE_ENV`. It does not read `.env.development` or `.env.test`. See [Environment variables](/runtime/environment-variables).
```toml bunfig.toml icon="settings"
[install]
registry = { url = "https://registry.npmjs.org", token = "$npm_token" }
```
---
See [`bun install`](/pm/cli/install).