Skip to main content

Overview

The pm up (or pm update) command updates dependencies in your project. It supports interactive mode and can update to the latest versions.

Syntax

Arguments

string[]
Specific packages to update. If omitted, updates all dependencies.

Options

boolean
default:"false"
Interactive mode - prompts for each update
boolean
default:"false"
Update to the latest version (not restricted by semver range)

Examples

Update All Dependencies

Output

Update Specific Package

Output

Update Multiple Packages

Output

Interactive Update

Output
Interactive mode (-i) is great for reviewing updates before applying them.

Update to Latest

Output

Combined Flags

Output

How It Works

From src/commands/up.ts:18-32:
The command:
  1. Detects your package manager
  2. Builds the update command with flags
  3. Executes the update with all arguments

Update Strategies

Semantic Versioning

By default, updates respect semver ranges in package.json:
package.json

Latest Version

With --latest, ignores semver ranges:

Interactive Selection

With -i, choose which updates to apply:

Package Manager Compatibility

All package managers support update, but some features like -i may vary by package manager.

Common Use Cases

Regular Maintenance

Major Version Updates

Single Package Update

Review Before Update

Best Practices

1

Check Current Versions

Use pm ls to see current versions before updating
2

Update Interactively

Use -i flag to review updates
3

Test After Updates

Run tests after updating dependencies
4

Commit Lock File

Always commit the updated lock file