Managing Updates
This guide covers two primary aspects of update management: Node.js version updates and npm dependency management.
Node.js Version Management
The stack runs on the current active LTS version of Node.js. You can update the Node.js version in two places:
Package.json Configuration
Update the engines.node
property:
{
"engines": {
"node": "20.3.1"
}
}
Important: Use exact versions, not ranges, as this affects server compilation.
Dockerfile Update
Match the Node.js version in your Dockerfile:
FROM node:20.3.1-bookworm-slim as base
Find available versions on Docker Hub.
Template Code Management
When starting a new project, you receive a complete codebase that you own. This means:
- Full control over the code
- Freedom to customize
- Manual update management
- Project-specific modifications
Update the code based on your needs rather than feeling compelled to stay current with every change in the template.
NPM Dependency Updates
Using npm-check-updates
NPM Check Updates helps manage dependency updates safely:
# Check available updates npx npm-check-updates
Understanding Update Types
Updates are color-coded by type:
- 🟢 Green: Patch updates (backward-compatible fixes)
- 🔵 Cyan: Minor updates (new features)
- 🔴 Red: Major updates (breaking changes)
Update Strategy
1. Patch Updates (Green)
# Update all patch versions npx npm-check-updates -u --target patch npm install
Run tests:
npm run test -- run npm run test:e2e:run
Commit changes:
git add . git commit -m "chore: update patch dependencies"
2. Minor Updates (Cyan)
Update individually:
npx npm-check-updates -u --filter <package-name> npm install
Review:
- Release notes
- New features
- Necessary code updates
Run tests and commit:
npm run test -- run npm run test:e2e:run git add . git commit -m "feat: update minor dependency versions"
3. Major Updates (Red)
Handle with care:
npx npm-check-updates -u -f <package-name> npm install
Before updating:
- Read release notes
- Plan migration
- Test thoroughly
- Update application code
Best Practices
Version Control
- Separate commits for different update types
- Clear commit messages
- Document breaking changes
- Tag major updates
Testing
- Run full test suite
- Check for deprecation warnings
- Verify all features work
- Test in staging environment
Documentation
- Update internal docs
- Note breaking changes
- Update configuration examples
- Update deployment guides
Monitoring
- Watch for deprecation notices
- Monitor security advisories
- Keep track of LTS schedules
- Review update impact
Troubleshooting
Common Issues
- Version conflicts
- Breaking changes
- Deprecated features
- Integration failures
Resolution Steps
- Check error logs
- Review package documentation
- Test in isolation
- Roll back if necessary
For deployment-related updates, see the deployment documentation. For testing strategies, refer to the testing documentation.