When editing dependency versions in package.json, follow the team’s agreed semver range convention rather than mixing styles ad hoc. Unless there is a specific compatibility reason, prefer caret (^) ranges for both dependencies and devDependencies, and update version specifiers in their own dedicated commits/PRs rather than bundling them with unrelated changes. Before bumping a dependency, verify:
engines field (e.g., don’t add a package needing Node 10+ if engines still allows Node 0.10).~ for ^) won’t allow an unintended downgrade or breaking patch for users upgrading from an older minor version.Example of correct update:
- "cookie-signature": "1.0.6",
+ "cookie-signature": "^1.2.1",
not:
- "cookie-signature": "1.0.6",
+ "cookie-signature": "1.1.0",
which silently tightens Node engine requirements and risks breaking installs for users with strict engine checks.