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
pm up [packages...] [options]
pm update [packages...] [options]
Arguments
Specific packages to update. If omitted, updates all dependencies.
Options
Interactive mode - prompts for each update
Update to the latest version (not restricted by semver range)
Examples
Update All Dependencies
Update Specific Package
Running: pnpm update typescript
Update Multiple Packages
Running: pnpm update react react-dom
Interactive Update
Running: pnpm update -i
? Choose dependencies to update:
◯ typescript 5.0.0 → 5.1.0
◯ react 18.2.0 → 18.3.0
◯ vite 4.3.0 → 4.4.0
Interactive mode (-i) is great for reviewing updates before applying them.
Update to Latest
Running: pnpm update --latest
Combined Flags
pm up -i --latest typescript
Running: pnpm update -i --latest typescript
How It Works
From src/commands/up.ts:18-32:
const updateHandler = (args: {
i: boolean;
latest: boolean;
args: ReadonlyArray<string>;
}) =>
Effect.gen(function* () {
const pm = yield* PackageManagerService;
const extraArgs: Array<string> = [];
if (args.i) extraArgs.push('-i');
if (args.latest) extraArgs.push('--latest');
extraArgs.push(...Array.from(args.args));
const cmd = ShellCommand.make(pm.name, 'update', ...extraArgs);
yield* Console.log(`Running: ${pm.name} update ${extraArgs.join(' ')}`);
yield* runShellCommand(cmd);
}).pipe(Effect.provide(PackageManagerLayer));
The command:
- 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 in package.json:
{
"dependencies": {
"react": "^18.2.0" // Updates to 18.x.x
}
}
pm up react
# Updates to latest 18.x.x version
Latest Version
With --latest, ignores semver ranges:
pm up --latest react
# Updates to latest version (e.g., 19.0.0)
Interactive Selection
With -i, choose which updates to apply:
pm up -i
# Shows interactive prompt for each available update
Package Manager Compatibility
| Package Manager | Command |
|---|
| pnpm | pnpm update |
| bun | bun update |
| npm | npm update |
All package managers support update, but some features like -i may vary by package manager.
Common Use Cases
Regular Maintenance
# Update all dependencies within semver ranges
pm up
Major Version Updates
# Update to latest versions interactively
pm up -i --latest
Single Package Update
# Update specific package
pm up typescript
Review Before Update
# Interactive mode to see what will change
pm up -i
Best Practices
Check Current Versions
Use pm ls to see current versions before updating Update Interactively
Use -i flag to review updates Test After Updates
Run tests after updating dependencies Commit Lock File
Always commit the updated lock filegit add pnpm-lock.yaml
git commit -m "chore: update dependencies"