빌드 설정
ignoreScripts#
- 기본값: false
- 유형: Boolean
프로젝트 package.json 및 해당 종속성에 정의된 스크립트를 실행하지 않습니다.
참고
이 플래그는 .pnpmfile.mjs의 실행을 막지 않습니다
childConcurrency#
- 기본값: 5
- 유형: Number
동시에 할당할 수 있는 자식 프로세스의 최대 개수로, node_modules를 빌드하는 데 사용됩니다. A zero or negative value is subtracted from the available parallelism, with a minimum of 1.
sideEffectsCache#
- 기본값: true
- Type: Boolean or Object
(pre/post)install 훅의 결과를 사용하고 캐시합니다.
설치 전후 스크립트가 패키지의 내용(예: 빌드 출력)을 수정하면 pnpm은 수정된 패키지를 전역 스토어에 저장합니다. On future installs on the same machine, pnpm reuses this cached, prebuilt version, which makes installs faster.
참고
다음과 같은 경우 이 설정을 비활성화하는 것이 좋습니다:
- 설치 스크립트가 패키지 디렉터리 외부의 파일을 수정하는 경우(pnpm은 이러한 변경 사항을 추적하거나 캐시할 수 없습니다).
- 스크립트가 패키지 빌드와 관련 없는 부수 효과를 수행하는 경우.
An object says the same thing in more detail, and is the canonical way to declare the remote tier:
sideEffectsCache:
read: true
write: true
remote:
org: acme
packages:
- native-addon
read: restore a build from the cache when one is present. Default true.write: save a package's build output to the cache. Default true.remote: reuse builds across machines; see below.exclude: packages whose builds never go through the cache; see below.
sideEffectsCache: true is the shorthand for reading and writing, and is what
the setting meant before it grew a remote tier. Writing without reading
(read: false, write: true) populates a cache the run never consumes, which is
what a job that warms one for others wants.
Since v12.2.0, the --side-effects-cache and --no-side-effects-cache flags, and
PNPM_CONFIG_SIDE_EFFECTS_CACHE, toggle the local cache only. A remote tier
declared under sideEffectsCache.remote is left in place, so a run can turn the
local cache off without losing the shared one.
sideEffectsCacheReadonly#
- 기본값: false
- 유형: Boolean
부수 효과 캐시가 있으면 사용만 하고, 새 패키지에 대해서는 생성하지 않습니다.
The older spelling of sideEffectsCache: { read: true, write: false }.
sideEffectsCache.remote#
Added in: v12.0.0
- 기본값: undefined
- Type: Object
Opt in to reusing a dependency's build output across machines, by restoring
signed, organization-scoped artifacts instead of running the package's
lifecycle scripts locally. The artifacts live on the server
remoteCache names: a pnpr server started with
artifacts.enabled: true, or, since v12.12.0, a server that speaks the
Turborepo Remote Cache API. This is a proof of concept: it is off unless
configured, and it restores artifacts on Linux/glibc, macOS, and Windows, on
x64 and arm64. Other operating systems and libc families build locally.
A repository declares eligibility and nothing else:
pnprServer: http://127.0.0.1:7677
allowBuilds:
native-addon: true
remoteCache:
org: acme
sideEffectsCache:
remote:
packages:
- native-addon
Declaring only remote leaves read and write at their defaults, so the
local cache keeps working as it did.
packages is an eligibility list, not a permission: a package is only a
candidate when it also passes allowBuilds, has
requiresBuild: true, and has a verified source integrity. Listing a package
here does not review its build scripts for you. Under the default
strictDepBuilds an install still fails with
ERR_PNPM_IGNORED_BUILDS when it reaches a build nobody has ruled on, and a
package denied with allowBuilds: false is never built, from the cache or
otherwise.
The organization and the trust material are set under
remoteCache. They can also be set under
sideEffectsCache.remote, where they lived before v12.12.0, and remoteCache
wins where both set a field. Everything describing the act of signing
(publish, keyId, builderId, imageDigest, architectureBaseline,
buildEnv, trustedKeys and privateKey) is refused in
pnpm-workspace.yaml with ERR_PNPM_WORKSPACE_REMOTE_SIDE_EFFECTS_TRUST, and
is read from the global configuration file or the
environment instead. A cloned repository is not a trust root, and must not be
able to turn the machine's signing key into a signing oracle.
Any cache failure (an unreachable server, an unverifiable signature, an incompatible platform, a bad blob) falls back to the ordinary local build. See Shared side-effects cache for the full setup, including the server flag, the trust material, and how an artifact is published.
Since v12.1.0, a restored artifact is saved in the shared store together with its signed origin. Before a later install reuses it, pnpm checks the signature again against the machine's current keys and revalidates its owner, package and source identity, platform, policy, and stored files. A bad remote variant is quarantined for that server and is not selected again.
참고
remoteSideEffectsCache is the older spelling of this setting, and
organization of its org field; both still work.
The two spellings are merged, not chosen between: a field set under both takes
its value from sideEffectsCache.remote, and a field set under only one is kept
either way. That is what lets a repository declare the org in
pnpm-workspace.yaml while the machine supplies the signing key from the global
config under whichever spelling it already used.
sideEffectsCache.exclude#
Added in: v12.14.0
- 기본값: undefined
- 유형: String[]
Packages whose build depends on something pnpm cannot include in the cache key,
such as the system libraries a native addon links against. pnpm builds a listed package in
every project and never restores or saves its build through the side-effects
cache, locally or on a remoteCache server. Under the
global virtual store, each project gets its own
copy of the package, so one project's build never reaches another.
sideEffectsCache:
exclude:
- java
- '@native/*'
- 'sharp@1.0.0 || 2.0.0'
Declaring only exclude leaves read and write at their defaults, so the
cache keeps working for every other package.
Entries use the same patterns as
minimumReleaseAgeExclude:
a package name, a @scope/* wildcard, or name@version with one or more exact
versions. A bare name covers every resolution of the package, git and tarball
URLs included. A name@version entry covers registry versions only.
A package that depends on a listed package gets a project-specific copy under the global virtual store as well, since its copy links to the listed package's.
remoteCache#
Added in: v12.12.0
- 기본값: undefined
- Type: Object
The server that shares build output between machines, and the keys every
shared artifact is signed and verified with. Both
sideEffectsCache.remote and the task cache of
pnpm pipeline use
it.
With url, artifacts live on a server that speaks the Turborepo Remote Cache
API, such as Vercel Remote Cache or a self-hosted implementation. Without it,
they live on pnprServer.
remoteCache:
org: acme
remoteCache:
url: https://vercel.com/api
team: team_abc123
trustedKeys:
ci-2026: <base64 P-256 SubjectPublicKeyInfo DER public key>
| 필드 | Where it may be set | 의미 |
|---|---|---|
url |
Global config or environment | The API base URL of a Turborepo Remote Cache server, such as https://vercel.com/api. |
team |
Global config or environment | A Vercel team ID (team_...) or team slug. |
org |
Anywhere | The organization that owns the artifacts. On a pnpr server, one of the owners it declares under artifacts.owners. It also names the organization pnpm pipeline --report records a run under. |
trustedKeys |
Global config or environment | The public keys an artifact must be signed by, keyed by key id. |
publish |
Global config or environment | true publishes what this machine builds: dependency builds and pnpm pipeline task results. A task result includes the task's output files and its captured terminal output. Defaults to false. Set under sideEffectsCache.remote, it publishes dependency builds only. |
privateKey, keyId, builderId |
Global config or environment | The key that signs published artifacts, the id consumers trust it under, and a label for the builder. Required with publish. |
imageDigest, architectureBaseline, buildEnv |
Global config or environment | Optional provenance recorded in the signed artifact. |
Every field is also read from the environment as PNPM_REMOTE_CACHE_ followed
by the field name in upper snake case, such as PNPM_REMOTE_CACHE_URL.
trustedKeys and buildEnv take a JSON object there. The environment takes
precedence over both files. A pnpm-workspace.yaml that sets a field marked
"Global config or environment" fails with
ERR_PNPM_WORKSPACE_REMOTE_CACHE_TRUST. A repository that could name the
server could have the machine's token sent to a server of its choosing.
Authenticating with Vercel Remote Cache#
pnpm sends the server the credential its
authentication settings hold for url, as it does for a
registry. Create an access token in your Vercel account settings, under
Tokens, scoped to the team that owns the cache. On your own machine, store
it:
pnpm config set //vercel.com/api/:_authToken "$VERCEL_TOKEN"
In CI, pass it in the environment for the one command instead:
env "pnpm_config_//vercel.com/api/:_authToken=$VERCEL_TOKEN" pnpm pipeline
Use this form rather than _auth. An _auth entry also
routes package requests to its URL.
pnpm does not read the token turbo login stores. That token expires within
hours, and only turbo renews it.
A Turborepo Remote Cache server holds one build per package for each combination of operating system, CPU architecture, and Node.js major, and a later publication replaces it. A machine restores a build when it meets the build's minimum OS or glibc version, and publishes only when it found none it could restore. Publish from the machine with the oldest system you support.
A server that pnpm would send credentials to must use HTTPS or a loopback address. Otherwise the remote cache is not used.
unsafePerm#
- 기본값: root로 실행 중이면 false, 그렇지 않으면 true
- 유형: Boolean
When set to false, lifecycle scripts run with TMPDIR set to the
package's node_modules/.tmp directory.
nodeOptions#
- 기본값: NULL
- 유형: String
NODE_OPTIONS 환경 변수를 통해 Node.js에 전달할 옵션입니다. 이는 pnpm 자체의 실행 방식에는 영향을 주지 않지만 라이프사이클 스크립트의 호출 방식에는 영향을 줍니다.
An empty value, such as --config.node-options= or PNPM_CONFIG_NODE_OPTIONS=, overrides a value from a lower-priority configuration source. With an empty nodeOptions, scripts retain NODE_OPTIONS from the parent environment or extraEnv.
기존 NODE_OPTIONS를 유지하려면 구성에서 ${NODE_OPTIONS}를 사용하여 기존 환경 변수를 참조할 수 있습니다:
nodeOptions: "${NODE_OPTIONS:- } --experimental-vm-modules"
verifyDepsBeforeRun#
- 기본값: install
- 유형: install, warn, error, prompt, false
이 설정을 사용하면 스크립트를 실행하기 전에 종속성 상태를 확인할 수 있습니다. 이 검사는 pnpm run 및 pnpm exec 명령에서 실행됩니다. 지원되는 값은 다음과 같습니다:
install-node_modules가 최신 상태가 아니면 자동으로 설치를 실행합니다. If that install fails, for example because the store is read-only or there is no network, pnpm prints a warning and runs the command anyway.warn-node_modules가 최신 상태가 아니면 경고를 출력합니다.prompt-node_modules가 최신 상태가 아니면 설치 실행 여부를 사용자에게 묻습니다.error-node_modules가 최신 상태가 아니면 오류를 발생시킵니다.false- 종속성 검사를 비활성화합니다.
A missing lockfile also counts as not up to date. pnpm install restores it from the installed dependencies.
Changing trustLockfile alone does not trigger a dependency reinstall before a script runs. An explicit pnpm install verifies the lockfile when that setting is off.
When the command is filtered, for example pnpm --filter foo run build, the check covers the selected projects and the workspace projects they depend on, and the install it runs is filtered the same way.
After a scope changes registries, a frozen install keeps the locked packages. A filtered command that would resolve dependencies checks whether its selected projects have already been resolved against the new registry. Run an unfiltered pnpm install --no-frozen-lockfile to update every project.
strictDepBuilds#
- 기본값: true
- 유형: Boolean
strictDepBuilds가 활성화되어 있으면 검토되지 않은 빌드 스크립트(postinstall 스크립트라고도 함)가 있는 종속성이 하나라도 있을 때 설치가 오류 종료 코드로 종료됩니다.
allowBuilds#
스크립트 실행을 명시적으로 허용(true)하거나 허용하지 않을(false) 패키지 매처의 맵입니다.
allowBuilds:
esbuild: true
core-js: false
# nx versions with build scripts not listed below will
# fail by default with ERR_PNPM_IGNORED_BUILDS
nx@21.6.4 || 21.6.5: true
nx@21.6.0: false
Exact versions in package matchers ignore SemVer build metadata. A denial also covers a package from a named registry, so nx@21.6.0: false blocks nx@work:21.6.0 too. An approval by name or version covers the default registry only. Approve a named-registry package by its exact key, such as nx@work:21.6.5: true.
Git-hosted packages: a package name on its own never approves builds for a git or tarball dependency, because the name alone does not identify the artifact. Approve one either by its exact resolved path (including the commit) or by its repository URL:
allowBuilds:
# Approves any commit from this repository
'foo@git+ssh://git@example.com/org/foo.git': true
# Approves only this exact commit
'bar@git+https://github.com/org/bar.git#abc123': true
리포지터리 형식을 사용하면 신뢰할 수 있는 git 종속성이 새 커밋마다 다시 승인하지 않고도 브랜치 업데이트 후에도 빌드 스크립트를 계속 실행할 수 있습니다. 키는 패키지 이름 뒤에 @와 git URL이 오며 #<ref> 접미사는 없습니다. 일치는 정확히 이루어지므로 같은 리포지터리에 대한 git+ssh://와 git+https:// URL은 별개의 키입니다.
The repository form also approves git-hosted packages that pnpm downloads as a tarball rather than clones, such as github: dependencies, which are fetched from codeload.github.com. foo@git+https://github.com/org/foo.git 항목은 pnpm이 리포지터리를 복제하든 tarball을 다운로드하든 foo를 승인합니다. GitLab 및 Bitbucket tarball 다운로드도 같은 방식으로 일치시킵니다. A specific resolved commit can also be approved or denied by its full tarball dep path.
패키지 이름에 의한 거부는 이런 식으로 제한되지 않습니다: foo: false는 foo가 레지스트리에서 오든 git에서 오든 foo를 차단합니다.
기본 동작: allowBuilds에 나열되지 않은 패키지는 기본적으로 허용되지 않으며 검토되지 않은 것으로 처리됩니다. 기본적으로 오류가 출력됩니다(strictDepBuilds의 기본값은 true입니다). strictDepBuilds를 false로 설정하면 대신 경고가 출력됩니다.
설치 중 allowBuilds에 아직 나열되지 않은 빌드 무시 종속성은 자리표시자 값과 함께 pnpm-workspace.yaml에 자동으로 추가되므로 직접 true 또는 false로 설정할 수 있습니다. The --allow-build flag on pnpm add and pnpm approve-builds writes its entries here as well.
Patched packages: since v12.4.0, a patch that adds an install script or a binding.gyp makes the package buildable, and the build goes through the same approval. When strictDepBuilds is false, an unapproved package appears under "Packages awaiting approval". When strictDepBuilds is true, the install fails with ERR_PNPM_IGNORED_BUILDS.
이전 설정에서 마이그레이션
이 설정을 자동으로 마이그레이션하려면 pnpx codemod run pnpm-v10-to-v11을 v10에서 v11로 마이그레이션 가이드에서 안내하는 대로 실행하세요.
다음 설정은 v11에서 제거되었으며 allowBuilds로 대체되었습니다: onlyBuiltDependencies, onlyBuiltDependenciesFile, neverBuiltDependencies, ignoredBuiltDependencies, 그리고 ignoreDepScripts.
이전:
onlyBuiltDependencies:
- electron
neverBuiltDependencies:
- core-js
ignoredBuiltDependencies:
- esbuild
이후:
allowBuilds:
electron: true
core-js: false
esbuild: false
permissions#
Added in: v12.11.0
- Type: Object
What each dependency may do, keyed by package. The keys have the same forms as the keys of allowBuilds. Each entry decides one or more capabilities:
build: the package may run its build scripts. Outranks the package'sallowBuildsentry.skills: pnpm may link the agent skills the package ships into the project's agent skill directories.truelinks every skill the package ships,falselinks none, and a list of skill names links exactly those. See Agent skills.
permissions:
drizzle-kit:
build: true
skills: [guide, migrate]
esbuild:
build: true
some-pkg:
skills: false
A skills list names the only skills of the package that pnpm links, and a skill outside the list is not offered for approval again.
false records a denial, so the package is not offered for approval again. pnpm approve writes these entries.
A build decision is written to permissions only when the file already has a permissions setting. Otherwise it is written to allowBuilds, which older pnpm versions read too.
permissions.rules and permissions.unused#
To choose how pnpm handles unmatched rules, put the package selectors under permissions.rules and set permissions.unused alongside it.
permissions:
unused: warn
rules:
example-tool:
skills: true
warn (the default) reports selectors in permissions or allowBuilds that match no dependency during a full workspace resolution. Both warn and ignore keep the permissions for future installs. The warning covers the workspace and locally included files. It skips rules supplied by config dependencies or added by an updateConfig hook.
skills.dirs#
Added in: v12.11.0
- Default: the agent skill directories detected under the workspace root for projects or the home directory for global packages, plus the directory of the agent running pnpm
- 유형: String[]
The directories that pnpm links approved agent skills into. In a project, paths are relative to the workspace root. In globalPackagesConfig in the global config.yaml, paths are relative to the home directory and must stay inside it. When set, it replaces the detected directories, and pnpm creates the ones that are missing. The first time skills are approved, pnpm approve or pnpm approve -g lists the detected directories and asks which ones to link into, recording the selected directories here. If you select no directories, pnpm keeps using the detected directories.
skills:
dirs:
- .claude/skills
globalPackagesConfig:
skills:
dirs:
- .agents/skills
- .claude/skills
An empty list turns agent skills off. pnpm stops offering them for approval and removes the ones it linked.
dangerouslyAllowAllBuilds#
- 기본값: false
- 유형: Boolean
true로 설정하면 종속성의 모든 빌드 스크립트(예: preinstall, install, postinstall)가 승인 없이 자동으로 실행됩니다. A package whose build is denied, by false in allowBuilds or build: false in permissions, is still blocked, so this setting allows every build except the denied ones. As everywhere else, a package's permissions entry outranks its allowBuilds entry.
경고
This setting allows all dependencies, including transitive ones, to run install scripts, both now and in the future. 현재 종속성 그래프가 안전해 보이더라도:
- 향후 업데이트로 신뢰할 수 없는 새로운 종속성이 추가될 수 있습니다.
- 기존 패키지가 이후 버전에서 스크립트를 추가할 수 있습니다.
- 패키지가 탈취되거나 손상되어 악성 코드를 실행하기 시작할 수 있습니다.
For maximum safety, only enable this if you're fully aware of the risks and trust the entire ecosystem you're pulling from. It's recommended to review and allow builds explicitly.