기타 설정
savePrefix#
- 기본값: '^'
- 유형: '^', '~', '', '='
package.json 파일에 설치된 패키지의 버전에 어떤 접두사를 붙일지 구성합니다.
예를 들어 패키지 버전이 1.2.3이면 기본적으로 버전이 ^1.2.3으로 설정되어 해당 패키지의 마이너 업그레이드를 허용하지만, pnpm config set save-prefix='~' 이후에는 ~1.2.3으로 설정되어 패치 업그레이드만 허용합니다.
With =, newly added dependencies are saved with an
explicit = operator (=1.2.3), which pins the exact version. pnpm update는 이렇게 고정된 버전을 업데이트할 때 = 연산자를 유지합니다.
추가된 패키지에 범위가 지정된 경우 이 설정은 무시됩니다. 예를 들어 pnpm add foo@2는 savePrefix 값과 관계없이 package.json의 foo 버전을 2로 설정합니다.
saveExact#
- 기본값: false
- 유형: Boolean
When set to true, pnpm add saves the resolved version without a range
operator, as the --save-exact CLI option does.
saveTypes#
Added in: v12.6.0
- 기본값: false
- 유형: Boolean
When set to true, pnpm add saves available @types/* packages in
devDependencies alongside registry dependencies. Packages that declare bundled
TypeScript types are skipped.
saveTypes: true
You can also pass it as a CLI flag: pnpm add --save-types express.
tag#
- 기본값: latest
- 유형: String
If you pnpm add a package and you don't provide a specific version, pnpm
saves the first of these that exists:
- A
catalog:reference, if the catalog pnpm saves to lists the package. - The range that every other workspace project declaring the package uses.
pnpm skips this step when the projects declare different ranges or one of
them uses a protocol, such as
workspace:. - The range a matching override sets.
- The version registered under the tag from this setting.
pnpm publish also publishes under this tag when --tag is not passed.
globalDir#
- 기본값:
- If the $PNPM_HOME env variable is set, then $PNPM_HOME/global
- $XDG_DATA_HOME 환경 변수가 설정된 경우 $XDG_DATA_HOME/pnpm/global
- Windows에서: ~/AppData/Local/pnpm/global
- macOS에서: ~/Library/pnpm/global
- Linux에서: ~/.local/share/pnpm/global
- 유형: path
전역 패키지를 저장할 사용자 정의 디렉터리를 지정합니다. pnpm stores the packages
in a v11 subdirectory of this directory.
globalBinDir#
- 기본값:
- If the $PNPM_HOME env variable is set, then $PNPM_HOME/bin
- 환경 변수 $XDG_DATA_HOME이 설정된 경우 $XDG_DATA_HOME/pnpm/bin
- Windows에서: ~/AppData/Local/pnpm/bin
- Apple macOS에서: ~/Library/pnpm/bin
- Linux에서: ~/.local/share/pnpm/bin
- 유형: path
전역으로 설치된 패키지의 bin 파일이 위치할 대상 디렉터리를 설정할 수 있습니다.
globalShims#
추가된 버전: v12.0.0-rc.2
- 기본값: { node: auto, deno: auto, bun: auto }
- 유형: Boolean, Object
Controls which globally installed packages get project-aware shims: global commands that run the version the current project asks for instead of the globally installed one.
이 설정은 패키지 이름을 정책에 매핑하는 맵입니다. 키는 명령 자체가 아니라 명령을 제공하는 패키지의 이름이므로, typescript 항목은 해당 패키지의 tsc bin에 적용됩니다.
globalShims:
node: auto
deno: false
typescript: prompt
지원되는 정책은 다음과 같습니다:
| 값 | 동작 |
|---|---|
auto(또는 true) |
후보가 게시자 서명으로 인증되면 자동으로 전환하고, 그렇지 않으면 한 번 확인을 요청합니다. |
prompt |
서명이 검증된 후보를 포함하여 모든 후보에 대해 확인 절차를 거칩니다. 응답은 여전히 기억되므로, 매 실행마다가 아니라 프로젝트와 후보별로 한 번만 묻습니다. |
always |
항상 전환하며, 묻지 않습니다. 프롬프트가 전역 버전으로 대체되는 CI에서 사용할 수 있습니다. |
false |
이 패키지에 대한 프로젝트 인식 shim을 비활성화합니다. |
버전 v12.0.0-rc.6부터는 두 명령이 이곳에 항목을 자동으로 기록합니다: pnpm shim add <pkg>는 shim을 연결하는 패키지를 기록하고, 패키지 관리자를 전역으로 설치하면(pnpm add -g yarn) 해당 패키지 관리자가 프로젝트의 고정 버전을 따르도록 기록됩니다. Neither overwrites an entry you set yourself, including false, and including a globalShims: false that turns every shim off.
Layers merge key by key over the built-in defaults, so a single entry can change one package without restating the rest. globalShims: { bun: false } leaves node and deno at auto.
스칼라 축약형은 병합하지 않고 전체 맵을 대체합니다: globalShims: false는 모든 프로젝트 인식 shim을 비활성화하고, globalShims: true는 기본값으로 재설정합니다.
경고
이 설정은 프로젝트가 쓸 수 없는 위치에서만 읽습니다: 전역 설정 파일, pnpm 홈 디렉터리 자체에 있는 pnpm-workspace.yaml, 그리고 PNPM_CONFIG_GLOBAL_SHIMS 환경 변수(JSON 값)이며, 이 순서대로 적용됩니다. A project's own pnpm-workspace.yaml is ignored. Otherwise a repository could grant itself the right to run its own binaries in place of your global ones.
Disabling a package, or changing its policy, takes effect on the very next command. The setting is re-read on each dispatch, so no reinstall is needed.
패키지를 새로 활성화하는 경우는 예외입니다. pnpm은 설치 시점에 어떤 bin에 대해 디스패치 shim을 작성할지 결정하므로, 비활성화된 상태에서 이미 전역으로 설치된 패키지는 변경 사항을 반영하려면 다시 설치해야 합니다:
pnpm add -g typescript
한 번의 호출에 대해서만 디스패치를 우회하려면 PNPM_SHIM_BYPASS=1을 설정하세요:
PNPM_SHIM_BYPASS=1 node --version
참고
프로젝트 인식 shim은 pnpm v12 기능이며 v11에서는 사용할 수 없습니다.
npmrcAuthFile#
- 기본값: ~/.npmrc
- 유형: path
레지스트리 인증 토큰이 들어 있는 파일의 경로입니다. 기본적으로 pnpm은 레지스트리 인증의 대체 수단으로 ~/.npmrc에서 인증 토큰을 읽습니다. 다른 파일을 사용하려면 이 설정으로 지정하세요.
이 설정은 프로젝트 수준의 pnpm-workspace.yaml에서는 설정할 수 없습니다; 전역 설정 파일, --npmrc-auth-file CLI 옵션 또는 PNPM_CONFIG_NPMRC_AUTH_FILE 환경 변수를 통해 설정하세요(npm 스타일의 NPM_CONFIG_USERCONFIG도 대체 수단으로 인정됩니다). 상대 경로는 작업 디렉터리를 기준으로 해석됩니다.
stateDir#
- 기본값:
- $XDG_STATE_HOME 환경 변수가 설정된 경우 $XDG_STATE_HOME/pnpm
- Windows: ~/AppData/Local/pnpm-state
- On macOS and Linux: ~/.local/state/pnpm
- 유형: path
The directory where pnpm stores machine-level state, including the update checker's pnpm-state.json file.
Since v12.5.0, task concurrency groups also store their shared slot files under stateDir/run-slots. Processes must use the same stateDir to share group limits. Different state directories create independent slot pools, so their combined task count can exceed the configured limit.
Set stateDir in the global configuration file or on the command line. It is ignored in project pnpm-workspace.yaml files.
cacheDir#
- 기본값:
- $XDG_CACHE_HOME 환경 변수가 설정된 경우 $XDG_CACHE_HOME/pnpm
- Windows: ~/AppData/Local/pnpm-cache
- macOS: ~/Library/Caches/pnpm
- Linux: ~/.cache/pnpm
- 유형: path
캐시(패키지 메타데이터, dlx 캐시, 일부 설치 검증 결과)의 위치입니다.
스토어와 마찬가지로 캐시 디렉터리는 서로 신뢰하는 사용자, 작업, 프로세스 간에만 공유하도록 설계되었습니다. 공유 cacheDir을 구성하거나 복원하는 경우 신뢰할 수 없는 사용자가 쓸 수 없도록 파일 시스템 권한으로 보호하세요.
useStderr#
- 기본값: false
- 유형: Boolean
값이 true이면 모든 출력이 stderr에 기록됩니다.
updateNotifier#
- 기본값: true
- 유형: Boolean
최신 버전보다 오래된 pnpm을 사용할 때 업데이트 알림을 표시하지 않으려면 false로 설정하세요.
pnpm install and pnpm add check at most once a day, and print how to get the
newer version. The check is skipped in CI and with --offline or
--prefer-offline.
preferSymlinkedExecutables#
- 기본값: node-linker가 hoisted로 설정되어 있고 시스템이 POSIX인 경우 true
- 유형: Boolean
node_modules/.bin에 명령 shim 대신 실행 파일에 대한 심볼릭 링크를 생성합니다. 명령 shim만 동작하는 Windows에서는 이 설정이 무시됩니다.
ignoreCompatibilityDb#
- 기본값: false
- 유형: Boolean
설치 중에 일부 패키지의 종속성이 자동으로 패치됩니다. 이를 비활성화하려면 이 설정을 true로 지정하세요.
The patches are applied from Yarn's @yarnpkg/extensions package, plus pnpm's
own curated entries.
Since v12.0.0, the database no longer carries entries that were derived from
static analysis of published packages. Those entries named packages a dependent
imported only for its types. Adding them was at best unnecessary and at worst
broke the dependent: @typescript-eslint/types gained a typescript dependency
resolved to the newest release, which put TypeScript 7 under older
@typescript-eslint versions and made ESLint fail with Cannot read properties of undefined (reading 'Intrinsic').
resolutionMode#
- Default: highest
- 유형: highest, time-based, lowest-direct
resolutionMode가 time-based로 설정되면 종속성은 다음과 같이 해석됩니다:
- 직접 종속성은 가장 낮은 버전으로 해석됩니다. 따라서 종속성에
foo@^1.1.0이 있으면1.1.0이 설치됩니다. - Subdependencies will be resolved from versions that were published no later than one hour after the newest direct dependency. If none of those versions satisfies a subdependency's range, pnpm installs the lowest version that does.
If minimumReleaseAge is also set, pnpm resolves subdependencies against whichever of the two cutoffs is earlier. If no version published before that cutoff satisfies a subdependency's range, pnpm installs the lowest matching version that is older than the minimumReleaseAge cutoff. If every matching version is newer than the minimumReleaseAge cutoff, pnpm falls back to the lowest matching version, and minimumReleaseAgeStrict decides whether pnpm installs it or fails. Only the minimumReleaseAge cutoff decides which versions pnpm reports as too new. A version that is newer than the time-based cutoff but older than the minimumReleaseAge cutoff is installed without a warning or error.
이 해석 모드를 사용하면 웜 캐시가 있는 설치가 더 빨라집니다. 또한 하위 종속성은 직접 종속성이 업데이트될 때만 업데이트되므로 하위 종속성 탈취 가능성도 줄어듭니다.
이 해석 모드는 npm의 full metadata에서만 동작합니다. 따라서 일부 시나리오에서는 더 느립니다. 하지만 Verdaccio v5.15.1 이상을 사용한다면 registrySupportsTimeField 설정을 true로 지정할 수 있으며, 이 경우 매우 빨라집니다.
resolutionMode가 lowest-direct로 설정되면 직접 종속성은 가장 낮은 버전으로 해석됩니다.
여기서는 package.json에 선언된 종속성만 직접 종속성으로 간주됩니다. 피어 종속성 중 autoInstallPeers가 추가하는 것은 프로젝트가 선언한 것이 아니므로 하위 종속성처럼 해석됩니다: 피어 범위를 만족하는 가장 높은 버전으로, 또는 time-based에서는 게시 날짜 기준 내에서 가장 높은 버전으로 해석됩니다.
registrySupportsTimeField#
- 기본값: false
- 유형: Boolean
사용 중인 레지스트리가 축약된 메타데이터에서 "time" 필드를 반환한다면 이 값을 true로 설정하세요. Verdaccio는 v5.15.1부터 이를 지원하며, 일부 레지스트리 프록시도 지원합니다.
This can also be declared per registry, through the supportsTimeField field of a registry declaration. 레지스트리 자체의 선언이 우선하며, 이 설정은 프로젝트가 설명하지 않는 모든 레지스트리에 적용됩니다.
extendNodePath#
- 기본값: true
- 유형: Boolean
값이 true이면 pnpm은 NODE_PATH 환경 변수를 명령 shim(node_modules/.bin에 생성되는 래퍼 스크립트)에 설정합니다. 값이 false이면 NODE_PATH가 설정되지 않습니다.
필요한 이유#
pnpm의 isolated node_modules layout은 패키지가 자신이 선언한 종속성에만 접근할 수 있음을 의미합니다. 하지만 CLI 도구가 명령 shim을 통해 실행될 때, 일부 라이브러리(특히 jest, eslint 등에서 사용하는 import-local)는 바이너리 자체 위치가 아닌 현재 작업 디렉터리에서 모듈을 해석합니다. Since the working directory is the project root, not the package inside
the virtual store, the standard node_modules resolution from the CWD won't
find the binary's transitive dependencies.
이 차이를 메우기 위해 pnpm은 NODE_PATH에 두 가지 유형의 경로를 포함합니다:
- The package's own dependencies directory (e.g.,
.pnpm/pkg@version/node_modules). This allows CWD-based resolution to find the correct versions of the package's sibling dependencies. - The hoisted
node_modulesdirectory (e.g.,.pnpm/node_modules). This is the directory where hoisted packages are placed whenhoistPatternis set. Node.js는 표준 해석 알고리즘으로 이 디렉터리를 찾을 수 없으므로NODE_PATH를 통해 제공해야 합니다.
NODE_PATH는 enableGlobalVirtualStore가 활성화된 경우에도 필수입니다.
전역 가상 스토어를 사용하면 패키지가 프로젝트 외부의 중앙 위치에서 심볼릭 링크되므로, 바이너리의 실제 경로에서 상위로 올라가는 Node.js의 표준 node_modules 탐색으로는 프로젝트 자체의 node_modules나 호이스팅된 종속성에 도달할 수 없습니다. 이 경우 올바른 해석을 위해 NODE_PATH에는 프로젝트의 루트 node_modules와 node_modules/.pnpm/node_modules에 있는 호이스팅 디렉터리가 모두 포함되어야 합니다.
비활성화해야 하는 경우#
프로젝트의 CLI 도구 중 작업 디렉터리에서 모듈을 해석하는 것이 하나도 없고 전역 가상 스토어를 사용하지 않는다고 확신한다면 이 값을 false로 설정해도 됩니다. 비활성화하면 명령 shim이 약간 더 단순해집니다.
deployAllFiles#
- 기본값: false
- 유형: Boolean
패키지를 배포하거나 로컬 패키지를 설치할 때 패키지의 모든 파일이 복사됩니다. 기본적으로 패키지의 package.json에 "files" 필드가 있으면 나열된 파일과 디렉터리만 복사됩니다.
embedReadme#
- 기본값: false
- 유형: Boolean
When set to true, pnpm pack and pnpm publish add the content of the
package's README file to the readme field of the packed package.json, unless
that field is already set. pnpm publish --embed-readme sets it for a single
command.
dedupeDirectDeps#
- 기본값: false
- 유형: Boolean
true로 설정하면 워크스페이스의 루트 node_modules 디렉터리에 이미 심볼릭 링크된 종속성은 하위 프로젝트의 node_modules 디렉터리에 심볼릭 링크되지 않습니다.
optimisticRepeatInstall#
- 기본값: true
- 유형: Boolean
활성화하면 설치를 진행하기 전에 빠른 검사를 수행합니다. 이렇게 하면 반복 설치나 모든 것이 최신 상태인 프로젝트에서의 설치가 훨씬 빨라집니다.
The check compares the manifests, the lockfile, and the patch files by content, so an edit is noticed even when it keeps the file's modification time. A filtered install checks only the selected projects and the workspace projects they depend on.
When the check finds that nothing changed, pnpm skips the install, including the projects' own lifecycle scripts, such as prepare. Set this to false to run those scripts on every install.
requiredScripts#
Scripts listed in this array are required in each project selected by pnpm -r run <script name>. Otherwise, the run fails.
requiredScripts:
- build
enablePrePostScripts#
- 기본값: true
- 유형: Boolean
true이면 pnpm은 모든 pre/post 스크립트를 자동으로 실행합니다. 따라서 pnpm foo를 실행하는 것은 pnpm prefoo && pnpm foo && pnpm postfoo를 실행하는 것과 같습니다.
scriptShell#
- 기본값: null
- 유형: path
pnpm run 명령으로 실행하는 스크립트에 사용할 셸입니다.
예를 들어, Windows에서 Git Bash를 사용하도록 강제하려면:
pnpm config set scriptShell "C:\\Program Files\\git\\bin\\bash.exe"
Since v12.4.0, a relative path in pnpm-workspace.yaml resolves from the workspace root, including for scripts that run in a nested package. A bare command name such as bash is still looked up on PATH.
shellEmulator#
- 기본값: false
- 유형: Boolean
When true, pnpm will use its built-in cross-platform, bash-like shell to
execute scripts.
이 옵션은 플랫폼 간 스크립팅을 단순화합니다. 예를 들어, 기본적으로 다음 스크립트는 POSIX 규격이 아닌 시스템에서 실패합니다.
"scripts": {
"test": "NODE_ENV=test node test.js"
}
하지만 shellEmulator 설정을 true로 지정하면 모든
플랫폼에서 동작합니다.
Since v12.8.0, a configured non-empty scriptShell wins over shellEmulator
for pnpm run and lifecycle scripts. The emulator runs only when scriptShell
is unset or empty.
Parameter expansions such as ${MODE:-dev} read the variable when the command runs. For example, export MODE=prod && echo ${MODE:-dev} prints prod.
참고
Node.js 22 이상에서는 pnpm의 도움 없이 스크립트를 실행할 수 있습니다. 위 예시의 경우 test 스크립트를 node --run test로 실행할 수 있습니다. 하지만 shellEmulator 옵션은 이 경우에 아무런 영향을 주지 않습니다. POSIX 기능에 의존하는 스크립트를 POSIX 규격이 아닌 환경에서 동작시키려면 pnpm run으로 실행해야 하며, node --run으로는 실행할 수 없습니다.
catalogMode#
Set catalog.mode alongside catalog.entries to choose how pnpm add uses the default catalog. The top-level catalogMode setting accepts the same values. When a file sets both, catalog.mode wins.
- 기본값: manual
- 유형: manual, strict, prefer
pnpm add를 실행할 때 종속성을 기본 카탈로그에 추가할지 여부와 추가 방식을 제어합니다. 세 가지 모드가 있습니다:
- strict - 카탈로그의 종속성 버전만 허용합니다. 카탈로그의 버전 범위를 벗어난 종속성을 추가하면 오류가 발생합니다.
- prefer - 카탈로그 버전을 우선하지만, 호환되는 버전을 찾지 못하면 직접 종속성으로 대체합니다.
- manual (기본값) - 종속성을 카탈로그에 자동으로 추가하지 않습니다.
Since v12.3.0, a specifier that names a location rather than a version is never moved into a catalog: local paths, local tarballs, tarball URLs, and workspace:\<path> ranges stay in the package.json that declares them. Such a specifier is resolved relative to its own project, so one catalog entry could not mean the same directory for every project referencing it.
catalog.defaultSaveTarget#
Set catalog.defaultSaveTarget alongside catalog.entries to choose where pnpm add saves a dependency. Use default for the default catalog or supply a named catalog. The command-line flags --save-catalog and --save-catalog-name take precedence.
catalog:
entries: {}
mode: prefer
defaultSaveTarget: tools
The top-level saveCatalogName setting continues to work. When a file sets both, catalog.defaultSaveTarget wins. If you define the default catalog under catalogs.default, use the top-level settings or move its entries to catalog.entries before using the nested settings.
ci#
- 기본값: true (환경이 CI로 감지된 경우)
- 유형: Boolean
이 설정은 현재 환경이 CI(지속적 통합) 환경인지 여부를 pnpm에 명시적으로 알려줍니다.
In CI, frozenLockfile defaults to true when a lockfile is present, the default reporter is append-only, and the update check is skipped.
This setting is ignored in project pnpm-workspace.yaml files.
catalog.entries and catalog.unused#
Put the default catalog's packages under catalog.entries to configure cleanup alongside them. Use entries: {} for an empty map. Without entries, a key named unused refers to a package.
catalog:
unused: prune
entries:
example-tool: ^2.0.0
catalog.unused accepts ignore (the default) or prune. Pruning covers the default catalog and all named catalogs in catalogs. When a file sets both catalog.unused and catalogPrune, catalog.unused wins.
catalogPrune#
- 기본값: false
- 유형: Boolean
값을 true로 설정하면 pnpm은 설치 중에 사용하지 않는 카탈로그 항목을 제거합니다.
cleanupUnusedCatalogs는 사용 중단된 이 설정의 이전 이름이며 계속 동작합니다; 둘 다 설정된 경우 catalogPrune이 우선합니다.
macosBackup.excludeModulesDir#
Added in: v12.6.0
- 기본값: false
- 유형: Boolean
When set to true on macOS, pnpm marks newly created node_modules, virtual-store, and similar directories with the com.apple.metadata:com_apple_backup_excludeItem extended attribute, so Time Machine skips them.
Set it in the global configuration file or via the PNPM_CONFIG_MACOS_BACKUP_EXCLUDE_MODULES_DIR environment variable. This setting is ignored in project pnpm-workspace.yaml files and on non-macOS platforms.
macosBackup:
excludeModulesDir: true
macosBackup.excludeStoreDir#
Added in: v12.6.0
- 기본값: false
- 유형: Boolean
When set to true on macOS, pnpm marks newly created package-store directories with the Time Machine exclusion attribute.
Set it in the global configuration file or via the PNPM_CONFIG_MACOS_BACKUP_EXCLUDE_STORE_DIR environment variable. This setting is ignored in project pnpm-workspace.yaml files and on non-macOS platforms.
macosBackup:
excludeStoreDir: true