Skip to content

Il registro predefinito è registry.npmjs.org. Questo può essere configurato globalmente in bunfig.toml:

toml
[install]
# imposta il registro predefinito come stringa
registry = "https://registry.npmjs.org"
# imposta un token
registry = { url = "https://registry.npmjs.org", token = "123456" }
# imposta nome utente/password
registry = "https://username:password@registry.npmjs.org"

Per configurare un registro privato con scope a una particolare organizzazione:

toml
[install.scopes]
# registro come stringa
"@myorg1" = "https://username:password@registry.myorg.com/"

# registro con nome utente/password
# puoi riferire variabili d'ambiente
"@myorg2" = { username = "myusername", password = "$NPM_PASS", url = "https://registry.myorg.com/" }

# registro con token
"@myorg3" = { token = "$npm_token", url = "https://registry.myorg.com/" }

.npmrc

Bun legge anche i file .npmrc, scopri di più.

Bun a cura di www.bunjs.com.cn