Auth & Registry Settings (.npmrc)
The settings on this page must be configured via .npmrc files. pnpm uses the npm CLI under the hood for publishing, so these settings need to be in a format that npm can read.
For details on how .npmrc files are loaded, see the pnpm config command.
For settings that can be configured in pnpm-workspace.yaml, see Settings (pnpm-workspace.yaml).
Registry Settings
registry
- 기본값: https://registry.npmjs.org
- 유형: url
npm 패키지 레지스트리의 기본 URL (후행 슬래시 포함).
@jsr:registry
Added in: v10.9.0
- Default: https://npm.jsr.io/
- 유형: url
The base URL of the JSR package registry.
<scope>:registry
지정된 범위의 패키지에 사용해야 하는 npm 레지스트리입니다. 예를 들어, @babel:registry=https://example.com/packages/npm/ 설정은 pnpm add @babel/core 또는 다른 @babel 범위 패키지를 사용할 때 적용됩니다. 패키지는 기본 레지스트리 대신 https://example.com/packages/npm 에서 가져옵니다.
Authentication Settings
<URL>:_authToken
지정된 레지스트리에 액세스할 때 사용할 인증 bearer 토큰을 정의합니다. 예시:
//registry.npmjs.org/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
환경 변수를 사용할 수도 있습니다. 예시:
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
또는 .npmrc 를 전혀 변경하지 않고 환경 변수를 직접 사용할 수도 있습니다.
npm_config_//registry.npmjs.org/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
<URL>:tokenHelper
토큰 헬퍼는 인증 토큰을 출력하는 실행 파일입니다. 이것은 authToken이 상수 값이 아니라 정기적으로 새로 고쳐지는 상황에서 사용할 수 있습니다. 스크립트나 다른 도구가 기존 리프레시 토큰을 사용하여 새 액세스 토큰을 얻을 수 있습니다.
헬퍼에 대한 경로 구성은 인수가 없는 절대 경로여야 합니다. 보안을 위해 사용자 .npmrc에서만 이 값을 설정할 수 있습니다. 그렇지 않으면 프로젝트가 프로젝트의 로컬 .npmrc 에 값을 배치하고 임의의 실행 파일을 실행할 수 있습니다.
기본 레지스트리에 대한 토큰 헬퍼 설정:
tokenHelper=/home/ivan/token-generator
지정된 레지스트리에 대한 토큰 헬퍼 설정:
//registry.corp.com:tokenHelper=/home/ivan/token-generator
Proxy Settings
https-proxy
- Default: null
- 유형: url
A proxy to use for outgoing HTTPS requests. If the HTTPS_PROXY, https_proxy, HTTP_PROXY or http_proxy environment variables are set, their values will be used instead.
If your proxy URL contains a username and password, make sure to URL-encode them. 예를 들어:
https-proxy=https://use%21r:pas%2As@my.proxy:1234/foo
Do not encode the colon (:) between the username and password.
http-proxy
proxy
- Default: null
- 유형: url
A proxy to use for outgoing http requests. If the HTTP_PROXY or http_proxy environment variables are set, proxy settings will be honored by the underlying request library.
local-address
- Default: undefined
- Type: IP Address
The IP address of the local interface to use when making connections to the npm registry.
maxsockets
- Default: networkConcurrency x 3
- 유형: Number
The maximum number of connections to use per origin (protocol/host/port combination).
noproxy
- Default: null
- Type: String
A comma-separated string of domain extensions that a proxy should not be used for.
SSL Settings
strict-ssl
- 기본값: true
- 유형: Boolean
Whether or not to do SSL key validation when making requests to the registry via HTTPS.
See also the ca option.
Certificate Settings
ca
- Default: The npm CA certificate
- Type: String, Array or null
레지스트리에 대한 SSL 연결을 위해 신뢰되는 인증 기관 서명 인증서입니다. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). 예시:
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
Set to null to only allow known registrars, or to a specific CA cert to trust only that specific signing authority.
Multiple CAs can be trusted by specifying an array of certificates:
ca[]="..."
ca[]="..."
See also the strict-ssl config.
cafile
- Default: null
- 유형: path
A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the ca setting, but allows for multiple CAs, as well as for the CA information to be stored in a file instead of being specified via CLI.
<URL>:cafile
Define the path to a Certificate Authority file to use when accessing the specified registry. 예시:
//registry.npmjs.org/:cafile=ca-cert.pem
<URL>:ca
Added in: v10.25.0
Define an inline Certificate Authority certificate for the specified registry. The value must be PEM-encoded, like the global ca setting, but it only applies to the matching registry URL.
//registry.example.com/:ca=-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
cert
- Default: null
- Type: String
A client certificate to pass when accessing the registry. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). 예시:
cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
It is not the path to a certificate file.
<URL>:cert
Added in: v10.25.0
Define an inline client certificate to use when accessing the specified registry. 예시:
//registry.example.com/:cert=-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----
<URL>:certfile
Define the path to a certificate file to use when accessing the specified registry. 예시:
//registry.npmjs.org/:certfile=server-cert.pem
key
- Default: null
- Type: String
A client key to pass when accessing the registry. Values should be in PEM format (AKA "Base-64 encoded X.509 (.CER)"). 예시:
key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
It is not the path to a key file. Use <URL>:keyfile if you need to reference the file system instead of inlining the key.
This setting contains sensitive information. Don't write it to a local .npmrc file committed to the repository.
<URL>:key
Added in: v10.25.0
Define an inline client key for the specified registry URL.
//registry.example.com/:key=-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----
<URL>:keyfile
Define the path to a client key file to use when accessing the specified registry. 예시:
//registry.npmjs.org/:keyfile=server-key.pem