pnpm update
Aliases:up
,upgrade
pnpm update
updates packages to their latest version based on the specifiedrange.
引数なしで実行すると、すべての依存関係を更新します。
TL;DR
コマンド | 意味 |
---|---|
pnpm up | Updates all dependencies, adhering to ranges specified inpackage.json |
pnpm up --latest | Updates all dependencies to their latest versions |
pnpm up foo@2 | Updatesfoo to the latest version on v2 |
pnpm up "@babel/*" | Updates all dependencies under the@babel scope |
パターンによる依存関係の選択
パターンを使用して特定の依存関係を更新できます。
Update allbabel
packages:
pnpm update "@babel/*"
Update all dependencies, exceptwebpack
:
pnpm update "\!webpack"
Patterns may also be combined, so the next command will update allbabel
packages, exceptcore
:
pnpm update "@babel/*" "\!@babel/core"
Options
--recursive, -r
Concurrently runs update in all subdirectories with apackage.json
(excludingnode_modules).
使用例:
pnpm --recursive update
# updates all packages up to 100 subdirectories in depth
pnpm --recursive update --depth 100
# update typescript to the latest version in every package
pnpm --recursive update typescript@latest
--latest, -L
Update the dependencies to their latest stable version as determined by theirlatest
tags (potentially upgrading the packages across major versions) as long as the version range specified inpackage.json
is lower than thelatest
tag (i.e. it will not downgrade prereleases).
--global, -g
グローバルパッケージを更新します。
--workspace
ワークスペースの全てのパッケージをリンクしようとします。 ワークスペース内のパッケージのバージョンに合わせて、バージョンを更新します。
いずれかのパッケージを更新する場合、ワークスペース内に更新された依存関係が見つからなかったとき、コマンドは失敗します。 For instance, the followingcommand fails ifexpress
is not a workspace package:
pnpm up -r --workspace express
--prod, -P
Only update packages independencies
andoptionalDependencies
.
--dev, -D
Only update packages indevDependencies
.
--no-optional
Don't update packages inoptionalDependencies
.
--interactive, -i
古くなった依存関係を表示し、更新する依存関係を選択することができます。
--no-save
Don't update the ranges inpackage.json
.