CLI & Node.js 설정
CLI 설정#
[no-]color#
- 기본값: auto
- 유형: auto, always, never
출력의 색상을 제어합니다.
- auto - 표준 출력이 터미널 또는 TTY인 경우 출력에 색상을 사용합니다.
- always - 터미널과 파이프의 차이를 무시합니다. You'll rarely
want this; in most scenarios, if you want color codes in your redirected
output, you can instead pass a
--colorflag to the pnpm command to force it to use color codes. The default setting is almost always what you'll want. - never - 색상을 끕니다.
--no-color에서 사용되는 설정입니다.
loglevel#
- 기본값: info
- 유형: debug, info, warn, error
지정된 수준 이상의 모든 로그가 표시됩니다.
대신 --silent를 전달하여 모든 출력 로그를 끌 수 있습니다.
reporter#
Selects the log reporter. See --reporter
for the available reporters and terminal-dependent defaults.
useBetaCli#
- 기본값: false
- 타입: Boolean
CLI의 베타 기능을 활성화하는 실험적 옵션입니다. 즉, CLI 기능에 호환성을 깨는 변경 사항이나 잠재적인 버그가 포함될 수 있습니다.
recursiveInstall#
- 기본값: true
- 타입: Boolean
이 옵션이 활성화되면 pnpm install의 기본 동작이 pnpm install -r의 동작이 되어, 모든 워크스페이스 또는 하위 디렉터리 패키지에서 설치가 수행됩니다.
그렇지 않으면 pnpm install은 현재 디렉터리의 패키지만 빌드합니다.
engineStrict#
- 기본값: false
- 타입: Boolean
이 옵션이 활성화되면 pnpm은 현재 Node 버전과 호환되지 않는다고 명시한 패키지를 설치하지 않습니다.
이 설정과 관계없이, 프로젝트(종속성이 아닌)가 engines 필드에 호환되지 않는 버전을 지정한 경우 설치는 항상 실패합니다.
npmPath#
- 유형: path
게시와 같은 일부 작업에 pnpm이 사용하는 npm 바이너리의 위치입니다.
pmOnFail#
추가된 버전: v11.0.0
- 기본값: download
- 유형: download, error, warn, ignore
선언된 pnpm 버전과 실행 중인 pnpm 버전이 일치하지 않을 때의 onFail 동작을 재정의하며, packageManager 필드와 devEngines.packageManager 모두에 적용됩니다.
download: download and run the declared pnpm version (this is the default and matches the previousmanagePackageManagerVersions: truebehavior).error: fail the command (equivalent to the previouspackageManagerStrictVersion: true).warn: print a warning but continue (equivalent to the previouspackageManagerStrict: falseorCOREPACK_ENABLE_STRICT=0).ignore: skip the check entirely (equivalent to the previousmanagePackageManagerVersions: false). 버전 관리를 asdf, mise, Volta 같은 외부 도구가 처리할 때 유용합니다.
A part of the configuration pnpm cannot read does not stop it from switching to the declared pnpm version, which reads the configuration itself. pnpm leaves out the file or setting it cannot read, and every other source still applies, so it switches only when the pmOnFail from the environment or a readable file is download.
CLI 플래그, 환경 변수 또는 pnpm-workspace.yaml로 설정할 수 있습니다:
pnpm install --pm-on-fail=ignore
pnpm_config_pm_on_fail=ignore pnpm install
pmOnFail: ignore
이 설정은 제거된 managePackageManagerVersions, packageManagerStrict, packageManagerStrictVersion 설정과 COREPACK_ENABLE_STRICT 환경 변수를 대체합니다.
마이그레이션:
| 제거된 설정 | 대체 설정 |
|---|---|
managePackageManagerVersions: true |
pmOnFail: download (기본값) |
managePackageManagerVersions: false |
pmOnFail: ignore |
packageManagerStrict: false |
pmOnFail: warn |
packageManagerStrictVersion: true |
pmOnFail: error |
COREPACK_ENABLE_STRICT=0 |
pmOnFail: warn |
이 설정을 변경하지 않고 특정 버전의 pnpm을 실행하려면 pnpm with도 참조하세요.
Node.js settings#
nodeVersion#
- 기본값: v 접두사를 제외한 node -v의 반환 값
- 유형: 정확한 semver 버전(범위가 아님)
패키지의 engines 설정을 확인할 때 사용할 Node.js 버전입니다.
프로젝트 기여자가 호환되지 않는 새 종속성을 추가하지 못하도록 하려면, 프로젝트 루트의 pnpm-workspace.yaml 파일에서 nodeVersion과 engineStrict를 사용하세요:
nodeVersion: 12.22.0
engineStrict: true
이렇게 하면 누군가 Node.js v22를 사용하더라도 Node.js v12.22.0을 지원하지 않는 새 종속성을 설치할 수 없습니다.
runtimeOnFail#
추가된 버전: v11.0.0
- 기본값: undefined
- 유형: download, error, warn, ignore
재정의 항목은 onFail 필드로, devEngines.runtime(및 engines.runtime)에 속하며 루트 프로젝트의 package.json에 있습니다. This is useful when you want a different local behavior than what is written in the manifest, for instance, forcing pnpm to download the declared runtime even when the manifest sets onFail: "warn":
runtimeOnFail: download
nodeDownloadMirrors#
추가된 버전: v11.0.0
- 기본값: undefined
- 유형: Record<string, string>
사용자 지정 Node.js 다운로드 미러를 pnpm-workspace.yaml에서 구성합니다. 키는 릴리스 채널입니다(release, rc, nightly, v8-canary 등) 값은 기본 URL입니다.
다음은 중국의 미러에서 Node.js를 다운로드하도록 pnpm을 구성하는 방법의 예입니다:
nodeDownloadMirrors:
release: https://npmmirror.com/mirrors/node/
rc: https://npmmirror.com/mirrors/node-rc/
nightly: https://npmmirror.com/mirrors/node-nightly/
Since v11.26.0, downloads from a mirror carry the npm registry credentials
configured for that URL, including bearer tokens, basic auth, and tokenHelper,
so a mirror behind an authenticating proxy works without a separate credential.