Перейти к основному содержимому
Версия: Будущая

pnpm update

Aliases: up, upgrade

pnpm update обновляет пакеты до последней версии на основе заданного диапазона.

При использовании без аргументов обновляет все зависимости.

TL;DR

КомандаОбозначение
pnpm upОбновляет все зависимости, придерживаясь диапазонов версий, указанных в package.json
pnpm up --latestUpdates all dependencies to their latest versions
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
# обновляет typescript до последней версии в каждом пакете
pnpm --recursive update typescript@latest

--latest, -L

Update the dependencies to their latest stable version as determined by their latest tags (potentially upgrading the packages across major versions) as long as the version range specified in package.json is lower than the latest tag (i.e. it will not downgrade prereleases).

--global, -g

Обновляет глобальные пакеты.

--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

Показывает устаревшие зависимостей и позволяет выбрать какие следует обновить.

--filter <селектор пакета>

Подробнее о фильтрации.