Skip to content

비공개 레지스트리는 .npmrc 또는 bunfig.toml 를 사용하여 구성할 수 있습니다. 둘 다 지원되지만 더 나은 유연성과 Bun 전용 옵션을 위해 bunfig.toml 사용을 권장합니다.

특정 npm 스코프에 대한 레지스트리를 구성하려면:

toml
[install.scopes]
# 문자열로
"@myorg1" = "https://usertitle:password@registry.myorg.com/"

# 사용자 이름/비밀번호가 있는 객체로
# 환경 변수를 참조할 수 있습니다
"@myorg2" = {
  username = "myusername",
  password = "$npm_pass",
  url = "https://registry.myorg.com/"
}

# 토큰이 있는 객체로
"@myorg3" = { token = "$npm_token", url = "https://registry.myorg.com/" }

bunfig.toml 은 환경 변수를 참조할 수 있습니다. Bun 은 .env.local, .env.[NODE_ENV], .env 에서 환경 변수를 자동으로 로드합니다. 자세한 내용은 문서 > 환경 변수 를 참조하세요.

toml
[install.scopes]
"@myorg3" = { token = "$npm_token", url = "https://registry.myorg.com/" }

Bun 의 패키지 관리자에 대한 전체 문서는 문서 > 패키지 관리자 를 참조하세요.

Bun by www.bunjs.com.cn 편집