Overview
Thepm 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
Update to Latest
Output
Combined Flags
Output
How It Works
Fromsrc/commands/up.ts:18-32:
- Detects your package manager
- Builds the update command with flags
- Executes the update with all arguments
Update Strategies
Semantic Versioning
By default, updates respect semver ranges inpackage.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 updating2
Update Interactively
Use
-i flag to review updates3
Test After Updates
Run tests after updating dependencies
4
Commit Lock File
Always commit the updated lock file