pnpm update
Aliases: up
, upgrade
pnpm update
는 지정된 범위를 기반으로 패키지를 최신 버전으로 업데이트합니다.
인수 없이 사용하면, 모든 의존성을 업데이트합니다.
요약
명령어 | 의미 |
---|---|
pnpm up | package.json 에 지정된 범위를 준수하여, 모든 의존성을 업데이트합니다. |
pnpm up --latest | package.json 에 지정된 범위를 무시하고, 모든 의존성을 업데이트합니다. |
pnpm up foo@2 | foo 를 v2의 최신 버전으로 업데이트합니다. |
pnpm up "@babel/*" | @babel 범위 아래의 모든 의존성을 업데이트합니다. |
Selecting dependencies with patterns
You can use patterns to update specific dependencies.
Update all babel
packages:
pnpm update @babel/*
Update all dependencies, except webpack
:
pnpm update !webpack
Patterns may also be combined, so the next command will update all babel
packages, except core
:
pnpm update @babel/* !@babel/core
옵션
--recursive, -r
package.json
이 있는 모든 하위 디렉토리에서 업데이트를 동시에 실행합니다 ( node_modules 제외).
사용 예:
pnpm --recursive update
# 최대 100개의 하위 디렉토리까지 모든 패키지를 업데이트합니다.
pnpm --recursive update --depth 100
# 모든 패키지의 타입스크립트를 최신 버전으로 업데이트합니다.
pnpm --recursive update typescript@latest
--latest, -L
Ignores the version range specified in package.json
. Instead, the version specified by the latest
tag will be used (potentially upgrading the packages across major versions).
--global, -g
Update global packages.
--workspace
Tries to link all packages from the workspace. Versions are updated to match the versions of packages inside the workspace.
If specific packages are updated, the command will fail if any of the updated dependencies are not found inside the workspace. For instance, the following command fails if express
is not a workspace package:
pnpm up -r --workspace express
--prod, -P
dependencies
및 optionalDependencies
의 패키지만 업데이트합니다.
--dev, -D
devDependencies
의 패키지만 업데이트합니다.
--no-optional
optionalDependencies
의 패키지를 업데이트하지 않습니다.
--interactive, -i
오래된 의존성을 표시하고 업데이트할 의존성을 선택합니다.