.npmrc files, allowing you to reuse existing registry/scope configurations.
We recommend migrating your
.npmrc file to Bun’s bunfig.toml format,
as it provides more flexible options and can let you configure Bun-specific options.Supported options
Set the default registry
The default registry is used to resolve packages, its default value isnpm’s official registry (https://registry.npmjs.org/).
To change it, you can set the registry option in .npmrc:
.npmrc
bunfig.toml option is install.registry:
bunfig.toml
Set the registry for a specific scope
@<scope>:registry allows you to set the registry for a specific scope:
.npmrc
bunfig.toml option is to add a key in install.scopes:
bunfig.toml
Configure options for a specific registry
//<registry_url>/:<key>=<value> allows you to set options for a specific registry:
.npmrc
_authTokenusername_password(base64 encoded password)_auth(base64 encoded username:password, e.g.btoa(username + ":" + password))
bunfig.toml option is to add a key in install.scopes:
bunfig.toml
link-workspace-packages: Control workspace package installation
Controls how workspace packages are installed when available locally:
.npmrc
bunfig.toml option is install.linkWorkspacePackages:
bunfig.toml
save-exact: Save exact versions
Always saves exact versions without the ^ prefix:
.npmrc
bunfig.toml option is install.exact:
bunfig.toml