pnpm install
별칭: i
pnpm install은 프로젝트의 모든 종속성을 설치하는 데 사용됩니다.
Package manifests and archive metadata larger than 64 MiB are rejected.
CI 환경에서, lockfile이 있지만 업데이트가 필요한 경우 설치가 실패합니다. To allow lockfile updates in CI, run pnpm install --no-frozen-lockfile.
workspace 내부에서 pnpm install은 모든 프로젝트의 모든 종속성을 설치합니다. If you want to disable this behavior, set the
recursiveInstall setting to false.
When a workspace project changes, unchanged direct dependencies in other projects
keep their locked versions if those versions still satisfy their declared ranges.
Use pnpm update to request dependency updates.
Changes to a workspace package's bin field are linked into its dependents'
node_modules/.bin on the next install, even with --frozen-lockfile and an
unchanged lockfile.
요약#
| 명령어 | 의미 |
|---|---|
pnpm i --offline |
스토어에서만 오프라인으로 설치 |
pnpm i --frozen-lockfile |
pnpm-lock.yaml이 업데이트되지 않음 |
pnpm i --lockfile-only |
오직 pnpm-lock.yaml만 업데이트됨 |
pnpm i --dry-run |
변경 사항을 저장하지 않고 미리 보기 |
의존성 필터링 옵션#
기존 lockfile이 없으면 pnpm은 lockfile을 생성해야 하며, 이 lockfile은 종속성 필터링과 관계없이 일관되어야 합니다. 따라서 lockfile이 없는 디렉터리에서 pnpm install --prod를 실행해도 개발 종속성은 여전히 해석되며, 해석에 실패하면 오류가 발생합니다. 이 규칙의 유일한 예외는 link: 종속성입니다.
--frozen-lockfile이 없으면 pnpm은 file: 종속성의 오래된 정보를 확인하므로, file:의 대상이 제거된 환경에서 --frozen-lockfile 없이 pnpm install --prod를 실행하면 오류가 발생합니다.
--prod, -P#
- 기본값: false
- 유형: Boolean
If true, pnpm will not install any package listed in devDependencies and will remove
those insofar they were already installed.
false이면 pnpm은 devDependencies 및 dependencies에 나열된 모든 패키지를 설치합니다.
--dev, -D#
Only devDependencies are installed and dependencies are removed insofar they
were already installed.
--no-optional#
optionalDependencies는 설치되지 않습니다.
--optional#
Install optionalDependencies even when the optional setting excludes them.
--no-runtime#
런타임 항목(예: devEngines.runtime을 통해 다운로드된 Node.js)의 설치를 건너뜁니다. 이때 lockfile은 변경되지 않으므로 frozen 설치도 여전히 검증을 통과합니다. 런타임 가져오기와 bin 링크만 건너뜁니다. A runtime that an earlier install linked is removed from node_modules.
이는 pnpm install이 실행되기 전에 런타임이 외부에서 제공되는(예: pnpm runtime -g set node <version>를 통해) CI 매트릭스에서 유용합니다.
This can also be set with runtime: false in pnpm-workspace.yaml.
옵션#
--ignore-workspace#
Install the current project as a standalone project, without discovering a
pnpm-workspace.yaml in a parent directory. The workspace's settings and other
projects do not apply. See the --ignore-workspace global option.
--force#
의존성 강제 재설치: 저장소에서 수정된 패키지를 다시 가져오고, 호환되지 않는 pnpm 버전에서 생성된 lockfile 및 모듈 디렉터리를 다시 만듭니다. --force also lifts engineStrict.
Since v12.7.0, --force no longer installs optional dependencies whose os, cpu, or libc do not match the host. Set forceIgnoresPlatform to true to install them anyway.
--offline#
- 기본값: false
- 유형: Boolean
true이면 pnpm은 스토어에 이미 있는 패키지만 사용합니다.
로컬에서 패키지를 찾을 수 없으면 설치가 실패합니다.
--no-offline#
Allow network requests even when the offline setting is true.
--prefer-offline#
- 기본값: false
- 유형: Boolean
true이면 캐시된 데이터의 최신 여부 확인을 건너뛰지만, 누락된 데이터는 서버에 요청합니다. 완전한 오프라인 모드를 강제하려면 --offline을 사용하세요.
--no-prefer-offline#
Don't prefer cached data even when the preferOffline setting is true.
--no-lockfile#
pnpm-lock.yaml 파일을 읽거나 생성하지 않습니다.
--lockfile-only#
- 기본값: false
- 유형: Boolean
이 옵션을 사용하면 pnpm-lock.yaml과 package.json만 업데이트합니다. node_modules 디렉터리에는 아무것도 기록되지 않습니다.
--lockfile-dir <dir>#
The directory in which pnpm-lock.yaml is created. Several projects can share one lockfile. It cannot be combined with --global.
--dry-run#
전체 의존성 해석을 실행하고, 디스크에 아무것도 쓰지 않은 채 실제 설치 시 무엇이 변경될지 보고합니다. 변경된 lockfile, 매니페스트 또는 node_modules는 저장되지 않습니다.
드라이 런이 완료되면, 실제 설치 시 lockfile이 업데이트될 것이라고 보고하더라도 종료 코드 0으로 종료됩니다.
--dry-run은 구성된 pnpr 서버와 함께 사용할 수 없습니다. 해당 설치 경로는 서버를 통해 해석하고 링크하기 때문입니다.
--fix-lockfile#
깨진 lockfile 항목을 자동으로 수정합니다.
--update-checksums#
Re-resolve every locked package and record the integrity the registry reports now in pnpm-lock.yaml. Use it when a registry rewrote its tarballs, or after a registry starts serving tars.
By default, an integrity mismatch is a hard failure: pnpm install exits with ERR_PNPM_TARBALL_INTEGRITY rather than silently re-resolving from the registry and overwriting the locked integrity. 이는 커밋된 lockfile을 함께 배포하는 프로젝트를, 손상된 레지스트리나 프록시 또는 다시 게시된 버전이 깨끗한 머신에서 공격자가 제어하는 콘텐츠로 바꿔치기하는 것으로부터 보호합니다.
--update-checksums는 정당한 경우(예: 레지스트리가 tarball을 다시 작성했고 새 바이트가 올바른지 확인한 경우)를 위한 범위가 좁은 옵트인입니다. 우회가 적용되면 여전히 경고가 출력되므로 해당 작업을 감사할 수 있습니다.
--force와 pnpm update는 의도적으로 integrity 검사를 우회하지 않습니다. --frozen-lockfile은 변경되지 않으며, --fix-lockfile은 문서화된 목적(누락된 lockfile 항목 채우기)을 유지하고 역시 우회 수단이 아닙니다.
--frozen-lockfile#
- 기본값:
- CI가 아닌 경우: false
- CI의 경우: lockfile이 있으면 true
- 유형: Boolean
값이 true이면 pnpm은 lockfile을 생성하지 않으며, lockfile이 매니페스트와 동기화되지 않았거나 / 업데이트가 필요하거나 lockfile이 없으면 설치에 실패합니다.
이 설정은 CI environments에서 기본적으로 true입니다. pnpm detects a CI environment with the same rules as the ci-info package. Set CI=false to turn detection off.
--no-frozen-lockfile#
Allows lockfile updates during installation. This is the inverse of --frozen-lockfile.
--prefer-frozen-lockfile#
Use the existing lockfile without re-resolving, even when the manifest might have changed. The inverse is --no-prefer-frozen-lockfile, which always re-resolves against the registry. See preferFrozenLockfile.
--ignore-manifest-check#
Skip the check that pnpm-lock.yaml is up to date with package.json under --frozen-lockfile. Use it only when you just wrote the lockfile yourself.
--trust-lockfile#
Skip verifying the lockfile against supply-chain policies. --no-trust-lockfile verifies it even when the configuration trusts it. See trustLockfile.
--auto-dedupe#
Deduplicate compatible dependency versions during installation. --no-auto-dedupe turns it off when the configuration turns it on. See autoDedupe.
--merge-git-branch-lockfiles#
모든 git branch lockfile을 병합합니다. git 브랜치 lockfile에 대해 자세히 알아보세요.
--merge-git-branch-lockfiles-branch-pattern <glob>#
Merge the git branch lockfiles when the current branch matches the pattern. The option can be repeated. See mergeGitBranchLockfilesBranchPattern.
--reporter=<name>#
- 기본값:
- TTY stdout의 경우: default
- TTY가 아닌 stdout의 경우: append-only
- 유형: default, append-only, ndjson, silent
터미널에 설치 진행률에 대한 디버그 정보를 기록할 기록자를 선택할 수 있습니다.
- silent - 치명적인 오류를 포함하여 콘솔에 아무것도 출력하지 않습니다
- default - stdout이 TTY일 때의 기본 리포터
- append-only - 출력이 항상 끝에 추가됩니다. 커서 조작이 수행되지 않습니다.
- ndjson - 가장 상세한 리포터입니다. Prints all logs in ndjson format. Fatal error records include the error code. Dependency resolution errors also include the parent packages in
pkgsStack.
출력되는 정보의 유형을 변경하려면 loglevel 설정을 사용하세요.
--shamefully-hoist#
- 기본값: false
- 유형: Boolean
기존 npm이나 yarn과 유사한 평탄한 node_modules 구조를 생성합니다.
경고: 이 방법은 강력히 권장하지 않습니다.
--ignore-scripts#
- 기본값: false
- 유형: Boolean
프로젝트 package.json 및 해당 종속성에 정의된 스크립트를 실행하지 않습니다.
--no-ignore-scripts#
Run lifecycle scripts even when the ignoreScripts setting is true.
--ignore-pnpmfile#
Don't load the hooks in .pnpmfile.cjs, including the pnpmfiles of config dependencies.
--node-linker <linker>#
- 유형: isolated, hoisted, pnp
Override the nodeLinker setting for this install.
--frozen-store#
Open the store read-only and skip all store writes, for a store on a read-only filesystem. Use it with --offline --frozen-lockfile. --no-frozen-store allows store writes when the configuration turns the read-only store on. See frozenStore.
--network-concurrency <number>#
Override the networkConcurrency setting.
--fetch-timeout <ms>#
Override the fetchTimeout setting.
--fetch-warn-timeout-ms <ms>#
Override the fetchWarnTimeoutMs setting.
--fetch-min-speed-ki-bps <number>#
Override the fetchMinSpeedKiBps setting.
--user-agent <string>#
The User-Agent header to send with registry requests.
--pnpr-server <url>#
Override the pnprServer setting.
--allow-build#
Added in: v12.7.0
Allow the named package to run its lifecycle scripts during this install, and
record it in the allowBuilds field of
pnpm-workspace.yaml so it stays allowed. Prefix a name with ! to deny its
scripts instead. The option can be repeated:
pnpm install --allow-build=esbuild --allow-build='!core-js'
The quotes keep a POSIX shell from treating ! as history expansion. In
Windows cmd.exe, leave them out.
writes:
allowBuilds:
esbuild: true
core-js: false
--filter <package_selector>#
--cpu=<name>#
설치할 네이티브 모듈의 CPU 아키텍처를 재정의합니다. 허용되는 값은 process.arch에서 파생된 package.json의 cpu 필드와 동일합니다.
--os=<name>#
설치할 네이티브 모듈의 OS를 재정의합니다. 허용되는 값은 package.json의 os 필드와 동일하며, 이는 process.platform에서 파생됩니다.
--libc=<name>#
설치할 네이티브 모듈의 libc를 재정의합니다. 허용되는 값은 package.json의 libc 필드와 동일합니다.