종속성 해석 설정
overrides#
이 필드를 사용하면 피어 종속성을 포함하여 종속성 그래프의 모든 종속성을 재정의하도록 pnpm에 지시할 수 있습니다. 이 기능은 모든 패키지가 종속성의 단일 버전을 사용하도록 강제하거나, 수정 사항을 백포트하거나, 종속성을 포크로 대체하거나, 사용하지 않는 종속성을 제거할 때 유용합니다.
The overrides field can only be set at the root of the project. A relative file: override is resolved from that root. The lockfile may use a shorter relative path to the same directory.
overrides 필드의 예시:
overrides:
"foo": "^1.0.0"
"quux": "npm:@myorg/quux@^1.0.0"
"bar@^2.1.0": "3.0.0"
"qar@1>zoo": "2"
패키지 선택자와 종속성 선택자를 ">"로 구분하여 오버라이드할 종속성이 속한 패키지를 지정할 수 있습니다. 예를 들어 qar@1>zoo는 qar@1의 zoo 종속성만 오버라이드하며, 다른 종속성에는 적용되지 않습니다. A selector can name only one parent.
Both the parent selector and the target selector support * wildcard patterns on package names:
overrides:
"@esbuild/*:optional": "-"
"@mui/*>react:peer": "^17.0.0 || ^18.0.0"
Override key syntax#
Tools that read overrides can parse each key using this ABNF grammar. The %s prefix marks case-sensitive literals.
override-key = [package-selector ">"] package-selector [dependency-type]
package-selector = package-name ["@" specifier]
package-name = ["@" 1*name-char "/"] 1*name-char
name-char = ALPHA / DIGIT / "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")"
specifier = <possibly empty dependency specifier containing no colon>
dependency-type = %s":prod" / %s":optional" / %s":peer"
Apply these rules to the decoded YAML key:
- Trim surrounding whitespace. A
>separates parent and target when it has a preceding character other than an ASCII space,|, or@. Reject keys with more than one such separator. Trim the parent and target separately. - Read a dependency type only at the end of the target. Within each package selector, the first
@after the initial character introduces the specifier. This preserves the leading@of a scoped name. - An unscoped name cannot start with
.,-, or_, or equalnode_modulesorfavicon.ico(case-insensitive). In a scoped name, the part after/cannot start with.. - Keep an absent specifier distinct from an empty one. An empty specifier is valid only for a convergence override on a single package name without a wildcard or dependency type.
| Key | Parent | Target | Target specifier | Dependency type |
|---|---|---|---|---|
leaf@>1 |
absent | leaf |
>1 |
absent |
top@>=1>leaf:peer |
top with specifier >=1 |
leaf |
absent | peer |
@scope/*:optional |
absent | @scope/* |
absent | optional |
leaf@ |
absent | leaf |
empty | absent |
For example, top:peer>leaf is invalid because the suffix is on the parent. top>middle>leaf is invalid because it names two parents.
Dependency-type selectors#
By default, an override applies to dependencies, devDependencies, optionalDependencies, and peerDependencies. Append a Dependency Selector Syntax pseudo-selector to the target to restrict the override to one dependency group:
:prodmatches onlydependencies.:optionalmatches onlyoptionalDependencies.:peermatches onlypeerDependencies.
overrides:
"foo:prod": "^2.0.0"
"@esbuild/*:optional": "-"
"react-dom>react:peer": "^18.0.0 || ^19.0.0"
When an override removes an entry from optionalDependencies with "-", pnpm also removes any duplicate declaration of that package from dependencies in the same manifest.
재정의된 버전을 워크스페이스의 다른 곳에서 사용하는 버전과 동기화하려면, 카탈로그에 버전을 정의하고 catalog: 프로토콜로 참조하세요. 이렇게 하면 버전이 한 곳에서 관리되며 종속성과 재정의 양쪽에서 참조됩니다:
catalog:
foo: "^1.0.0"
overrides:
foo: "catalog:"
catalog:<name>을 사용하여 이름이 지정된 카탈로그를 참조할 수도 있습니다. 자세한 내용은 카탈로그를 참조하세요.
특정 패키지를 사용할 때 해당 패키지의 종속성 중 하나가 필요하지 않다면 -를 사용하여 제거할 수 있습니다. 예를 들어 foo@1.0.0 패키지가 사용하지 않는 기능을 위해 bar라는 대형 패키지를 요구하는 경우, 이를 제거하면 설치 시간을 줄일 수 있습니다:
overrides:
"foo@1.0.0>bar": "-"
이 기능은 대부분의 선택적 패키지를 안전하게 건너뛸 수 있는 optionalDependencies에서 특히 유용합니다.
수렴 overrides#
A selector with an empty range, "pkg@", is a convergence override. 일치하는 모든 엣지를 무조건 다시 작성하는 일반 재정의와 달리, 수렴 재정의는 종속성 엣지의 버전이 해당 엣지가 선언한 범위를 충족하는 경우에만 그 엣지를 다시 작성합니다:
overrides:
"form-data@": 4.0.6
위 설정을 사용하면 form-data: "^4.0.5"를 선언한 종속성은 4.0.6으로 고정되며, ^3.0.0을 선언한 종속성은 자체 해석을 유지합니다. This lets compatible consumers converge on a single version, now and for any dependent added in the future, without forcing an incompatible version on the rest of the graph.
규칙:
- 값은 정확한 버전이어야 합니다. 범위, dist-tag, 또는
-제거는ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE와 함께 실패합니다. 카탈로그 항목이 정확한 버전으로 해석되는 한catalog:참조는 허용됩니다. - 일반 semver 엣지만 참여합니다.
workspace:,catalog:,npm:, dist-tag 또는 git/URL 지정자로 선언된 엣지는 의미 있는 "충족" 관계가 없으므로 그대로 유지됩니다. - 수렴 재정의는 부모 선택자와 결합할 수 없습니다:
"parent>pkg@"는 거부됩니다. - 동일한 엣지에 대해서는 일반 재정의가 항상 수렴 재정의보다 우선합니다.
전체 해석 결과 선언된 모든 범위가 더 새로운 버전도 허용하는 것으로 확인되면, pnpm은 재정의가 오래되었다고 경고하고 대신 수렴할 버전을 알려줍니다.
피어 종속성 재정의#
재정의는 peerDependencies에도 적용됩니다. Use :peer on the target selector to target only peerDependencies without overriding direct or transitive runtime dependencies of the same name:
- Version ranges (e.g.,
^1.0.0,*), workspace, and catalog protocols: the peer dependency range is replaced inpeerDependencies. - Non-range specifiers such as
link:,file:, ornpm:protocols:peerDependenciesis left unchanged (so an untyped override like"foo": "file:./foo.tgz"replacesfooindependencieswithout wiping out consumers' peer version ranges). - Removal (
-): the peer dependency (and itspeerDependenciesMetaentry) is removed.
For example, to widen the react peer dependency of react-dom, or to allow any version for @babel/* peer dependencies:
overrides:
"react-dom>react:peer": "^18.0.0 || ^19.0.0"
"@babel/*:peer": "*"
To replace a package's peer dependency with a direct dependency, add the dependency in packageExtensions and remove the peer declaration with :peer:
packageExtensions:
react-dom:
dependencies:
react: "18.3.1"
overrides:
"react-dom>react:peer": "-"
overrides.rules and overrides.unused#
Put selectors under overrides.rules to configure unused overrides alongside them. Use rules: {} for an empty map. Without rules, a key named unused refers to a package.
overrides:
unused: ignore
rules:
example-tool: ^2.0.0
overrides.unused accepts warn (the default) or ignore. The warning follows the same rules as warnUnusedOverrides. When a file sets both, overrides.unused wins.
warnUnusedOverrides#
- 기본값: true
- 유형: Boolean
When true, an install that resolves the whole dependency graph warns about every entry in overrides that matched no dependency, in one line such as 2 overrides matched no dependency: foo, parent>child.
Only the entries that pnpm-workspace.yaml or a local file it includes declares are reported. Entries a config dependency or an updateConfig hook adds are not. Convergence overrides are not reported either, since pnpm warns about them when they go stale, and neither are removal overrides ("-"), which leave nothing to match against.
packageExtensions#
packageExtensions 필드는 기존 패키지 정의를 추가 정보로 확장하는 방법을 제공합니다. 예를 들어 react-redux의 peerDependencies에 react-dom이 있어야 하지만 없는 경우, packageExtensions를 사용하여 react-redux를 패치할 수 있습니다:
packageExtensions:
react-redux:
peerDependencies:
react-dom: "*"
packageExtensions의 키는 패키지 이름 또는 패키지 이름과 semver 범위이므로, 패키지의 일부 버전만 패치할 수 있습니다:
packageExtensions:
react-redux@1:
peerDependencies:
react-dom: "*"
packageExtensions를 사용하여 확장할 수 있는 필드는 다음과 같습니다: dependencies, optionalDependencies, peerDependencies, peerDependenciesMeta.
더 큰 예시:
packageExtensions:
express@1:
optionalDependencies:
typescript: "2"
fork-ts-checker-webpack-plugin:
dependencies:
"@babel/core": "1"
peerDependencies:
eslint: ">= 6"
peerDependenciesMeta:
eslint:
optional: true
팁
저희는 Yarn과 함께 생태계의 손상된 패키지를 패치하기 위한 packageExtensions 데이터베이스를 관리하고 있습니다.
packageExtensions를 사용한다면 업스트림에 PR을 보내 확장을 @yarnpkg/extensions 데이터베이스에 기여하는 것을 고려해 주세요.
allowedDeprecatedVersions#
이 설정을 사용하면 특정 패키지의 사용 중단 경고를 끌 수 있습니다.
예시:
allowedDeprecatedVersions:
express: "1"
request: "*"
위 구성을 사용하면 pnpm은 request의 모든 버전과 express의 v1에 대한 사용 중단 경고를 출력하지 않습니다.
update#
이 섹션의 설정은 pnpm update 및 pnpm outdated 명령을 조정합니다.
update.ignoreDeps#
때로는 종속성을 업데이트할 수 없는 경우가 있습니다. 예를 들어 최신 버전의 종속성이 ESM을 사용하기 시작했지만 프로젝트가 아직 ESM을 사용하지 않을 수 있습니다. Annoyingly, such a package will always be printed out by the pnpm outdated command and updated, when running pnpm update --latest. 하지만 업그레이드하지 않으려는 패키지를 ignoreDeps 필드에 나열할 수 있습니다:
update:
ignoreDeps:
- load-json-file
패턴도 지원되므로 스코프의 모든 패키지를 무시할 수 있습니다: @babel/*.
The ignored packages still update when you name them, as in pnpm update load-json-file. They stay unchanged when every selector is negated, as in pnpm update '!webpack'.
update.changeset#
- 기본값: false
- 유형: Boolean
true이면 pnpm update는 워크스페이스 매니페스트를 업데이트한 후 변경 의도를 작성하며, patch 상승은 dependencies 또는 optionalDependencies가 업데이트로 변경된 모든 워크스페이스 패키지에 대해, major 상승은 peerDependencies가 변경된 경우에 선언합니다. --changeset을 전달하는 것과 같습니다; 한 번의 실행에서만 설정을 재정의하려면 --no-changeset을 전달하세요.
update.githubActions#
- 기본값: false
- 유형: Boolean
true이면 pnpm update와 pnpm outdated는 저장소의 워크플로 파일에서 참조하는 GitHub Actions도 확인합니다. --include-github-actions를 전달하는 것과 같습니다. GitHub Actions 업데이트를 참조하세요.
update.githubActionsServer#
- 기본값:
GITHUB_SERVER_URL환경 변수, 없으면 https://github.com - 유형: URL
워크플로 파일에서 참조하는 GitHub Actions의 리포지토리를 호스팅하는 GitHub 서버의 기본 URL입니다(예를 들어, GitHub Enterprise Server). URL은 https:// 또는 http:// 프로토콜을 사용해야 합니다. 신뢰할 수 있는 네트워크의 신뢰할 수 있는 서버에만 http://를 사용하세요: 액션을 커밋 해시에 고정하는 데 사용되는 ref는 이 URL을 통해 가져오며, 암호화되지 않은 트래픽은 변조될 수 있습니다.
정보
updateConfig.ignoreDependencies is the deprecated name of update.ignoreDeps and keeps working. When both are set, the update section takes precedence and a warning is printed.
supportedArchitectures#
설치를 실행 중인 시스템의 아키텍처와 일치하지 않더라도, 선택적 종속성을 설치하고자 하는 아키텍처를 지정할 수 있습니다.
예를 들어, 다음 구성은 Windows x64용 선택적 종속성을 설치하도록 지정합니다:
supportedArchitectures:
os:
- win32
cpu:
- x64
이 구성은 Windows, macOS 및 현재 설치를 실행 중인 시스템의 아키텍처에 대한 선택적 종속성을 설치합니다. 이 패키지에는 x64와 arm64 CPU용 아티팩트가 모두 포함되어 있습니다:
supportedArchitectures:
os:
- win32
- darwin
- current
cpu:
- x64
- arm64
또한 supportedArchitectures는 시스템의 libc 지정도 지원합니다.
참고
Copying node_modules between platforms can cause native-module load errors,
such as invalid ELF header or not a valid Win32 application. For packages
that publish platform-specific optional dependencies, list the target operating
systems, CPUs, and C libraries in supportedArchitectures before installing.
The lockfile can contain separate entries for each platform variant.
This setting does not cross-compile native addons. If a package builds its addon in an install script, install or rebuild it on the target platform.
Platform lists#
Added in: v12.5.0
Instead of the os, cpu, and libc mapping, list the exact platforms to prepare:
supportedArchitectures:
- linux-x64
- linux-x64-musl
- darwin-arm64
- win32-x64
Each entry is a platform tag: <os>-<cpu>, then for Linux musl when the platform uses musl, then the floors and ABI the platform has, such as linux-x64-manylinux_2_28 (glibc 2.28), darwin-arm64-macos_14_0, win32-x64-windows_10_0, linux-x64-napi8, or linux-x64-node127 (a Node.js ABI). <os> and <cpu> are Node.js names, so freebsd-x64 and linux-loong64 are platforms too. Linux entries without a C library mean glibc.
The spellings pnpm accepted before platform tags still work: glibc or gnu for the C library, other names of an architecture such as amd64, a musllinux_<major>_<minor> wheel baseline, and Rust target triples, so x86_64-unknown-linux-gnu is equivalent to linux-x64. current includes the platform running the install. Python resolves for the Linux, macOS, and Windows platforms of the list and reports the others.
The list prepares only the named platforms. The mapping form continues to work with its existing meaning. Python uses these targets together with python.versions when locking for multiple environments.
optional#
- 기본값: true
- 유형: Boolean
Set to false to skip optional dependencies during installation, including
transitive optional dependencies. Equivalent to
pnpm install --no-optional.
ignoredOptionalDependencies#
참고
Deprecated: use overrides with :optional and "-" instead (for example, "fsevents:optional": "-" and "@esbuild/*:optional": "-"). ignoredOptionalDependencies continues to work for backward compatibility.
선택적 종속성의 이름이 이 배열에 포함되어 있으면 해당 종속성은 건너뜁니다. 예시:
ignoredOptionalDependencies:
- fsevents
- "@esbuild/*"
forceIgnoresPlatform#
Added in: v12.7.0
- 기본값: false
- 유형: Boolean
When true, pnpm install --force also installs
optional dependencies whose os, cpu, or libc do not match the host. When
false, --force refetches every package but still skips optional dependencies
built for other platforms.
pnpm v11 behaved as if this setting were true. To install optional
dependencies for other platforms on purpose, prefer
supportedArchitectures.
minimumReleaseAge#
- Default: 1440
- 유형: number (minutes)
To reduce the risk of installing compromised or defective packages, you can delay the installation of newly published versions. 대부분의 경우 악성 릴리스는 한 시간 이내에 발견되어 레지스트리에서 제거됩니다.
minimumReleaseAge는 버전이 게시된 후 pnpm이 해당 버전을 설치하기까지 경과해야 하는 최소 분 수를 정의합니다. 이는 전이적 종속성을 포함한 모든 종속성에 적용됩니다. It does not apply to a config dependency pinned with version+integrity.
예를 들어 다음 설정은 최소 하루 전에 릴리스된 패키지만 설치할 수 있도록 합니다:
minimumReleaseAge: 1440
A registry declared serverType: pnpr supports a minimumReleaseAge of at most 43200 minutes (30 days).
minimumReleaseAgeExclude#
- 기본값: undefined
- 유형: string[]
minimumReleaseAge를 설정했지만 특정 종속성은 항상 최신 버전을 즉시 설치해야 하는 경우, 해당 종속성을 minimumReleaseAgeExclude에 나열할 수 있습니다. 제외는 패키지 이름 기준으로 동작하며 해당 패키지의 모든 버전에 적용됩니다.
예시:
minimumReleaseAge: 1440
minimumReleaseAgeExclude:
- webpack
- react
이 경우 webpack과 react를 제외한 모든 종속성은 최소 하루가 지나야 하며, 이 두 패키지는 릴리스 즉시 설치됩니다.
패턴을 사용할 수도 있습니다. 예를 들어 조직의 모든 패키지를 허용하려면 다음과 같이 합니다:
minimumReleaseAge: 1440
minimumReleaseAgeExclude:
- '@myorg/*'
특정 버전(또는 ||를 사용해 여러 버전을 나열한 목록)을 예외로 지정할 수도 있습니다. Exact versions ignore SemVer build metadata. For example, an exception for 1.0.0-rc.1+build.7 matches 1.0.0-rc.1.
minimumReleaseAge: 1440
minimumReleaseAgeExclude:
- nx@21.6.5
- webpack@4.47.0 || 5.102.1
minimumReleaseAgeExcludePrune#
- 기본값: false
- 유형: Boolean
When set to true, pnpm install, pnpm add, pnpm update, pnpm remove, and pnpm dedupe prune the entries of minimumReleaseAgeExclude in pnpm-workspace.yaml that the freshly written lockfile no longer resolves: a version that is gone is dropped (an entry is removed once none of its versions remain), and an entry for a package that is no longer in the lockfile is removed too. Pruning keeps name patterns that contain * or ? and negated patterns that start with !. Pruning also checks resolved configuration dependencies and their transitive dependencies.
With per-project lockfiles, a full workspace install checks every project's lockfile before pruning. A filtered install skips cleanup in that layout. Comments on the entries that are kept survive the rewrite.
minimumReleaseAgeIgnoreMissingTime#
- 기본값: true
- 유형: Boolean
true이면 pnpm은 minimumReleaseAge 검사를 건너뛰며, 이는 레지스트리 메타데이터에 time 필드가 포함되지 않은 패키지에 해당합니다(일부 비공개 레지스트리와 미러는 이 필드를 생략합니다). 이 경우 패키지를 설치하는 대신 해석을 실패시키려면 false로 설정하세요.
minimumReleaseAgeIgnoreMissingTime: false
The setting also governs trustPolicy, which reads the same publish dates: trustPolicy: no-downgrade skips a package the registry cannot date, with a warning, rather than failing the install with ERR_PNPM_MISSING_TIME.
The opt-in covers a registry that cannot date its releases, not a package a registry says it never published: during lockfile verification, a lockfile entry missing from a packument that does date every version it lists remains a hard failure.
referenceTime#
- 기본값: undefined
- Type: String (an RFC 3339 timestamp)
The reference time used to evaluate time-dependent settings. When unset, pnpm uses the current time. Currently, this applies to minimumReleaseAge and trustPolicyIgnoreAfter, during both resolution and lockfile verification.
A fixed reference time keeps these age thresholds unchanged between runs. It does not freeze registry metadata or affect timeouts, retries, or cache expiration.
Set it in pnpm-workspace.yaml or with the PNPM_CONFIG_REFERENCE_TIME environment variable. The global config.yaml does not apply it. In pnpm-workspace.yaml, a value that is not a timestamp, or is more than 10 minutes later than the current time, fails the command. From any other source, such a value is ignored with a warning. A job that advances the time should write one safely in the past, such as the start of the current day.
While a minimumReleaseAge cutoff, or a trustPolicyIgnoreAfter window under trustPolicy: no-downgrade, counts back from the setting, an install that uses pnprServer resolves locally.
referenceTime: "2026-11-01T00:00:00Z"
minimumReleaseAgeStrict#
- 기본값:
minimumReleaseAge가 명시적으로 구성된 경우 true, 그렇지 않으면 false - 유형: Boolean
요청된 범위 내에서 minimumReleaseAge 제약 조건을 충족하는 종속성 버전이 없을 때 pnpm의 동작 방식을 제어합니다. false이면 pnpm은 minimumReleaseAge 제약 조건을 충족하지 않는 버전으로 대체하여 설치가 성공할 수 있도록 합니다. true이면 pnpm은 대신 해석을 실패시킵니다.
The default depends on whether you configured minimumReleaseAge yourself: if you set it explicitly (in pnpm-workspace.yaml, in the global config.yaml, through a PNPM_CONFIG_* variable, or on the command line), strict mode is on by default so the setting is enforced. minimumReleaseAge의 내장 기본값(1440분)은 하위 호환성을 위해 엄격하지 않습니다.
minimumReleaseAgeStrict: true
When resolving through a pnpr server, strict mode fails the request if no mature version matches. In non-strict mode, pnpm adds fallback versions selected by the server to minimumReleaseAgeExclude in pnpm-workspace.yaml.
trustPolicy#
- 기본값: off
- 유형: no-downgrade | off
이 설정을 no-downgrade로 설정하면 패키지의 신뢰 수준이 이전 릴리스에 비해 낮아진 경우 pnpm이 실패합니다. 예를 들어 패키지가 이전에는 신뢰할 수 있는 게시자에 의해 게시되었지만 현재는 출처 증명만 있거나 신뢰 증거가 없는 경우 설치가 실패합니다. 이는 침해되었을 가능성이 있는 버전의 설치를 방지하는 데 도움이 됩니다. 신뢰 검사는 semver가 아닌 게시 날짜만을 기준으로 합니다. 이전에 게시된 버전 중 하나라도 더 강력한 신뢰 증거를 가지고 있었다면 패키지를 설치할 수 없습니다. Prerelease versions are ignored when evaluating trust evidence for a non-prerelease install, so a trusted prerelease cannot block a stable release that lacks trust evidence.
The check also covers the pnpm version a project pins in packageManager or devEngines.packageManager. pnpm fails before it switches to that version or records it in the lockfile.
trustPolicyExclude#
- 기본값: []
- 유형: string[]
신뢰 정책 검사에서 제외할 패키지 선택자 목록입니다. 이를 통해 trustPolicy 요구 사항을 충족하지 않더라도 특정 패키지나 버전을 설치할 수 있습니다. Exact versions ignore SemVer build metadata.
예시:
trustPolicy: no-downgrade trustPolicyExclude: - 'chokidar@4.0.3' - 'webpack@4.47.0 || 5.102.1' - '@babel/core@7.28.5'
trustPolicyIgnoreAfter#
- 기본값: undefined
- 유형: number (minutes)
지정한 분 수보다 오래 전에 게시된 패키지에 대해서는 신뢰 정책 검사를 무시할 수 있습니다. 이는 엄격한 신뢰 정책을 활성화할 때 유용합니다. 오래된 패키지 버전(서명이나 출처 증명을 사용한 게시 절차가 없을 수 있음)은 오래되었기 때문에 안전하다고 가정하고, 수동으로 제외하지 않아도 설치할 수 있게 해줍니다.
trustPolicyExcludePrune#
Added in: v12.4.0
- 기본값: false
- 유형: Boolean
When set to true, pnpm install, pnpm add, pnpm update, pnpm remove, and pnpm dedupe prune the entries of trustPolicyExclude in pnpm-workspace.yaml that the freshly written lockfile no longer resolves: a version that is gone is dropped (an entry is removed once none of its versions remain), and an entry for a package that is no longer in the lockfile is removed too. Pruning keeps name patterns that contain * or ? and negated patterns that start with !. Pruning also checks resolved configuration dependencies and their transitive dependencies.
With per-project lockfiles, a full workspace install checks every project's lockfile before pruning. A filtered install skips cleanup in that layout. Comments on the entries that are kept survive the rewrite.
trustLockfile#
- 기본값: false
- 유형: Boolean
When true, pnpm install skips the supply-chain verification pass that re-applies minimumReleaseAge, trustPolicy, and blockExoticSubdeps to every entry in the loaded lockfile. 설치 과정에서 lockfile을 이미 신뢰할 수 있는 것으로 취급합니다.
Useful in environments where the lockfile is effectively part of the trusted base: closed-source projects where every commit comes from a trusted author. 오염된 lockfile(기여자가 CI가 강제하는 것보다 약한 정책하에서 작성한 것)이 통과될 수 있으므로, 외부 협력자가 lockfile을 편집할 수 있는 경우에는 항상 이 값을 false로 두세요.
대규모 워크스페이스에서는 검증 단계가 설치하는 동안 패키지별 레지스트리 메타데이터를 메모리에 유지합니다; 이를 비활성화하면 공급망 검사를 포기하는 대신 메모리 사용량이 줄어듭니다. 기본 frozenLockfile CI 워크플로를 사용하는 대부분의 프로젝트는 이 값을 설정할 필요가 없습니다.
blockExoticSubdeps#
- 기본값: true
- 유형: Boolean
true로 설정하면 직접 종속성(루트 package.json에 나열된 종속성)만 이색 소스(git 저장소나 직접 tarball URL 등)를 사용할 수 있습니다. All transitive dependencies must be resolved from a trusted source, such as the configured registry, workspace packages, or trusted GitHub repositories (node, bun, deno). Non-local packages cannot resolve host filesystem paths (file: or link:) outside their own package archive unless rewritten by workspace overrides, packageExtensions, or .pnpmfile.cjs.
이 설정은 전이적 종속성이 신뢰할 수 없는 위치에서 코드를 가져오는 것을 방지하여 종속성 공급망을 보호하는 데 도움이 됩니다.
이색 소스에는 다음이 포함됩니다:
- Git 저장소 (
git+ssh://...) - 직접 tarball URL 링크 (
https://.../package.tgz)
A pnpr server does not fetch exotic subdependencies. With pnprServer set and blockExoticSubdeps: false, pnpm resolves locally.
registries#
- 기본값: undefined
- 유형: Record<string, RegistryDeclaration> 또는 Record<string, string>
프로젝트가 패키지를 설치하는 레지스트리를 선언합니다. Each registry is declared once, keyed by its URL, with everything pnpm knows about it in the entry: the scopes routed to it, the bare-specifier prefix it answers to, how the server lays out tarball URLs (serverType, supportsTimeField), and how many requests pnpm keeps in flight to it (networkConcurrency). 각 필드에 대한 전체 설명은 전용 레지스트리 페이지에 있습니다.
registries:
https://npm.corp.example.com/:
serverType: artifactory
scopes: ["@my-org", "@internal"]
prefix: work
스코프를 URL에 매핑하는 이전 형식도 여전히 허용됩니다. default 키는 주 레지스트리를 설정하며(registry라는 .npmrc 설정과 동일), 스코프 키는 특정 패키지 스코프에 대한 레지스트리를 구성합니다:
registries:
default: https://registry.npmjs.org/
"@my-org": https://private.example.com/
"@internal": https://nexus.corp.com/
두 형식은 하나의 맵에서 혼용할 수 없습니다.
pnpm normalizes https://registry.npmjs.com/ to https://registry.npmjs.org/. Credentials configured for either hostname at the registry root apply to the canonical registry. HTTP URLs, custom ports, and registry subpaths are unchanged.
For URL-scoped environment credentials, an explicit registry.npmjs.org entry takes precedence over a registry.npmjs.com entry.
This setting may also be defined in the global configuration file (config.yaml), which is useful for registries that should apply to every project on the machine rather than to a single repository. Ecosystem indexes, routes (scopes and prefix), and networkConcurrency are read from there; serverType and supportsTimeField shape the lockfile, so they are read only from pnpm-workspace.yaml. See where the setting may live.
namedRegistries#
- 기본값: undefined
- 유형: Record<string, string>
참고
Deprecated: declare a prefix in registries instead. See the Registries page. namedRegistries는 여전히 읽히지만, registries가 선언하지 않은 접두사에 대해서만 읽힙니다; 두 설정이 모두 접두사를 선언하면 pnpm이 경고합니다. Everything below about aliases (the built-in ones, reserved names, and the lockfile keys) applies to prefix-declared aliases the same way.
패키지를 설치할 때 접두사로 사용할 수 있는 이름 있는 레지스트리 별칭을 vlt의 이름 있는 레지스트리 별칭 방식으로 정의합니다. 예를 들어, 다음과 같이 구성하면:
namedRegistries:
gh: https://npm.pkg.github.example.com/
work: https://npm.work.example.com/
pnpm add work:@corp/lib@^2.0.0은 @corp/lib@^2.0.0을 https://npm.work.example.com/에서 해석합니다.
인증 정보는 기존의 URL별 .npmrc 항목(예를 들어, //npm.pkg.github.com/:_authToken=...)에서 가져오므로 별도의 인증 메커니즘이 필요하지 않습니다.
This setting may also be defined in the global configuration file (config.yaml), so an alias like work: can be shared across every project on the machine.
내장 별칭#
다음 두 별칭은 별도 구성 없이 작동합니다:
| 별칭 | 레지스트리 | 참고 |
|---|---|---|
gh: |
https://npm.pkg.github.com/ |
GitHub Packages npm 레지스트리입니다. |
npmjs: |
https://registry.npmjs.org/ |
공개 npm 레지스트리입니다. |
Entries you define under namedRegistries are merged on top of these, so either one can be overridden. GitHub Enterprise Server users point gh at their own host, and an organization that mirrors or proxies npmjs should point npmjs at the mirror:
namedRegistries:
gh: https://npm.pkg.github.example.com/
npmjs: https://npm.internal.example.com/
npmjs:는 기본 registry가 내부 프록시 등 다른 곳을 가리키는 경우에도 종속성을 공개 레지스트리에 고정합니다:
{
"dependencies": {
"left-pad": "npmjs:^1.3.0"
}
}
The npm: prefix cannot do this. It is the alias protocol (npm:<name>@<range>) and resolves through whatever registry points at.
내장 URL은 pnpm이 패키지를 검증할 때 lockfile에 기록된 tarball URL과 대조하는 접두사이기도 합니다. 자체 프록시로 npmjs를 중계하면서 별칭을 재정의하지 않으면, tarball URL이 registry.npmjs.org에 있는 항목은 미러가 아닌 공개 레지스트리를 기준으로 검증됩니다. This only affects lockfiles that record such a URL (a canonical URL for your configured registry is omitted from the lockfile), and only when a tarball-URL, minimumReleaseAge, or trustPolicy check runs.
예약된 별칭 이름#
An alias that shadows a reserved dependency specifier prefix (file, link, workspace, runtime, npm, jsr, git, github, gitlab, bitbucket, catalog, custom, http, https, ssh) is rejected with ERR_PNPM_RESERVED_NAMED_REGISTRY_NAME. Since v12.5.0, pkg is also reserved, regardless of case, for Package URLs. Since v12.13.0, tool is reserved for provisioned tools. 또한 별칭은 문자로 시작해야 하며 문자, 숫자, ., _, -만 포함할 수 있습니다.
이름 있는 레지스트리의 lockfile 기록#
A package resolved from a named registry is recorded in pnpm-lock.yaml under a registry-qualified key, <name>@<registryName>:<version>:
packages:
foo@work:1.0.0:
resolution: {integrity: sha512-...}
Keyed by name@version alone, the same name and version served by two registries would collapse onto a single entry, and whichever resolved first would decide the tarball that every consumer got. 이는 패키지 대체 위험입니다: 비공개 레지스트리에서 받을 것으로 예상한 패키지가 같은 이름과 버전을 게시한 다른 레지스트리에서 설치될 수 있으며, lockfile에는 이를 드러내는 정보가 전혀 없습니다. 레지스트리로 한정된 키는 각 레지스트리에 고유한 항목을 부여하고 종속성이 어느 레지스트리에서 왔는지 고정합니다.
The lockfile format version is unchanged, and qualified keys appear only for packages resolved from a named registry, including the built-in gh: and npmjs: aliases, which need no namedRegistries entry. Most packages from the default registry keep plain keys, as described below. A project that declares no prefix and installs nothing through an alias sees no difference, and older pnpm versions keep reading the file.
The key names the registry a package resolved from, not the way its dependency was written. A registry that declares a prefix, through prefix in registries or through namedRegistries, keys every package resolved from it with that prefix: one written as work:^1.0.0 and one written as a plain range whose scope registries routes to that URL. A plain range and a prefixed specifier that reach one registry therefore share one packages: entry and one copy in node_modules/.pnpm, so a published package that depends on @work/util by a plain range shares the copy your project installs through work:. The built-in gh: and npmjs: aliases qualify only the specifiers that spell them, unless you declare that prefix yourself. The same name and version served by two registries still get two entries.
Packages from the default registry, the one the registry setting names, keep plain keys. That includes packages installed through a prefix that points at the default registry, such as npmjs pointed at the npm mirror your registry setting uses. A plain range and such a prefixed specifier share the plain entry. The exception is a package whose scope registries routes to another registry: npmjs:@work/util is keyed @work/util@npmjs:<version> when @work routes elsewhere.
When several prefixes declare one registry, its packages are keyed by the lexicographically smallest prefix, so work:^1.0.0 and zeta:^1.0.0 pointing at one URL record foo@work:1.0.0. The specifier in package.json is left as written.
주의
별칭을 통해 설치된 종속성이 있다면, v11.20.0 이상에서 처음 수행하는 non-frozen 설치가 해당 항목의 키를 다시 지정하며, 이는 lockfile diff로 나타납니다. Commit it. That diff is the fix being applied. 검토도 하세요: 예상하지 못한 레지스트리로 옮겨진 항목은 조사해 볼 가치가 있습니다.
The same applies when a scope you route reaches a registry that also declares a prefix: the next pnpm install moves the scope-routed entries under the prefix and merges them with the prefixed ones. A frozen install keeps installing the lockfile as recorded.
프로젝트에 참여하는 모든 사람이 먼저 v11.20.0 이상으로 이전하도록 하세요. 이전 버전의 pnpm도 키가 다시 지정된 lockfile을 문제없이 읽고 frozen 설치에도 영향이 없지만, 레지스트리로 한정된 키를 직접 생성하지는 않습니다: lockfile을 업데이트하는 모든 설치는 해당 항목을 이전 형식으로 되돌려 쓰고, 다음에 최신 pnpm으로 설치하면 다시 한정됩니다. 그러면 lockfile이 두 형식 사이를 오가게 되며, 이전 형식인 동안에는 프로젝트가 다시 위험에 노출됩니다. 의도적으로 lockfile 형식 버전을 변경하지 않았기 때문에 pnpm은 이를 감지하여 경고할 수 없습니다.
There is no setting to keep the old behavior. The old shape is the vulnerability.
A plain key records no registry, so pnpm remembers in the workspace state (node_modules/.pnpm-workspace-state-v1.json) which registry each scope routed to when it last resolved the lockfile. When you route a scope to another registry, the next pnpm install resolves that scope's packages and their dependencies again from the new registry, at the locked versions it serves, and picks another version in range for a locked version it does not serve. A frozen install keeps installing the lockfile as recorded. Without that record, as in a fresh clone, pnpm reads the plain keys as resolved from the registries configured now. Only scope routes are tracked this way: changing the default registry, which is routinely a switch between mirrors, does not resolve anything again.
Every non-built-in alias that the lockfile references must stay declared, through prefix in registries or through namedRegistries. 별칭이 사라진 항목을 읽으면 ERR_PNPM_MISSING_NAMED_REGISTRY 오류로 실패하며 기본 레지스트리로 대체되지 않는데, 대체하면 다른 패키지를 가져오게 되기 때문입니다. 별칭의 이름을 바꾸면 해당 별칭을 사용하던 패키지가 다시 해석됩니다.
Tarball URLs that follow the standard registry layout are not written to the lockfile for named-registry packages; they are recomputed from the alias's declared URL on demand.
pnprServer#
- 기본값: null
- 유형: String
URL of a pnpr server. See Install acceleration.
When set, pnpm install offloads dependency resolution to the remote pnpr server. pnpm sends its workspace manifests and registry configuration to the server, and the server resolves the dependency graph against those registries, streaming back resolved package metadata frames as it walks the graph so pnpm can download tarballs in parallel. Once resolution finishes, the server returns the complete lockfile and pnpm links node_modules locally.
Public packages are fetched directly from their respective registries in parallel. Private packages configured through pnpr are fetched from its registry endpoint using server-side upstream credentials; client upstream registry credentials are not sent to the pnpr server.
pnprServer: https://pnpr.example.com/
This can also be configured via the --config.pnprServer=<url> command-line option or the PNPM_CONFIG_PNPR_SERVER environment variable.
If the server refuses a setting the install uses, or cannot return the lockfile format pnpm reads, pnpm prints a warning and resolves locally.
When pnprServer is set, authentication headers configured for the pnpr server URL in .npmrc (for example, //pnpr.example.com/:_authToken=...) authenticate requests to the server over HTTPS or loopback HTTP.
When remote resolution fails, pnpm reports the server's ERR_PNPR_ error code and reason.
autoDedupe#
Added in: v12.6.0
- 기본값: false
- 유형: Boolean
When set to true, pnpm install and pnpm add deduplicate compatible dependency versions during installation. If a dependency appears at multiple versions and one version satisfies every range in the workspace, pnpm picks that version for all of them.
When set to false, each project's dependencies resolve from its own ranges. For example, a project with ajv: "*" gets the latest Ajv even if another project depends on ajv@^6. Packages that a project lists in peerDependencies still follow the versions other projects use. Run pnpm dedupe to make both projects use one version. Set autoDedupe: true if you check the lockfile with pnpm dedupe --check.
Deduplication covers the whole workspace. A filtered command such as pnpm --filter <project> add can also change the lockfile entries of projects outside the filter. Those projects get the deduplicated versions linked on the next pnpm install.
autoDedupe: true
Frozen installs (--frozen-lockfile) leave the lockfile unchanged. Deduplication only runs when the lockfile is being written.
To let installs on other machines reuse a deduplicated lockfile, set lockfile.includeResolutionSettings.
pnpm install --lockfile-only skips resolution when nothing changed since a deduplicating pnpm install --lockfile-only wrote the lockfile. Such an install keeps the lockfile even if versions were published since then, or if only a setting such as resolutionMode changed. Run pnpm dedupe to apply such a change.