Dependency upgrade
1. Inventory
- What is outdated:
npm outdated,pnpm outdated,pip list --outdated/uv pip list --outdated,go list -m -u all,cargo outdated(plugin),bundle outdated,composer outdated. - What is vulnerable:
npm audit,pip-audit,govulncheck ./...,cargo audit,bundle audit. Note the advisory IDs and which versions fix them. - Current runtime versions and their support status (for Node.js, Python, Ruby, Go etc., check the official release/EOL schedule before choosing a target).
2. Plan
- One concern per change: security patches first (smallest version that fixes), then minor/patch bumps in a batch, then each major upgrade on its own.
- For a major version: read the changelog and official migration/upgrade guide for every major in between. Skipping several majors is often easiest one major at a time.
- Check peer dependencies and plugins that must move together (framework + its router + its test utils).
- Search the codebase for every deprecated API the guide lists.
3. Upgrade
- Use the package manager, not hand-edited version strings, so the lockfile stays consistent (
npm install pkg@^5,uv add 'pkg>=5,<6',go get pkg@v5,cargo update -p pkg/ edit +cargo update). - Run official codemods if the project provides them, then review their diff.
- Fix compile/type errors first, then failing tests, then deprecation warnings.
- Do not silence new warnings or pin around a breaking change without saying so.
4. Verify
- Full test suite, typecheck, lint, production build.
- Run the app and smoke-test the areas the changelog mentions.
- Check bundle size or startup time for frontend/CLI projects when a major dependency changed.
- Review the lockfile diff: unexpected new transitive packages deserve a look (typosquats, huge additions).
5. Report
Per dependency: from -> to, why, breaking changes encountered and how they were fixed, anything deferred. Link the changelog/migration guide you used.
Never
- Never upgrade everything to latest in one commit and hope.
- Never delete and regenerate the whole lockfile unless asked; it silently upgrades every transitive dependency.
- Never ignore an audit finding without recording why it does not apply.