https://tduyng.com/atom.xml

Different ways to batch update Node.js dependencies

Here are a few simple ways to batch update all the Node.js dependencies in package.json:

  • yarn v2:

    yarn upgrade-interactive
    

    This gives you an interactive list so you can choose exactly which packages to update.

  • npm:
    Use npm-check-updates.

    npm install -g npm-check-updates
    ncu -i # interactive update
    

    This automatically updates your package.json with the latest versions.

  • pnpm:

    pnpm update -i # interactive update
    pnpm update --latest # update all to latest versions
    
  • bun:

    bun update --latest # update all to latest versions
    
  • deno:

    deno outdateed --update --latest # update dependencies to latest versions, ignoring semver requirements
    
  • taze:
    If you don't want to rely on a specific package management, taze is another tool that smartly upgrades your dependencies.

  • CI

    If you’d rather automate the whole process on CI, consider integrating tools like Renovate or Dependabot into your workflow. They’ll automatically open pull requests with updates, so you can review and merge changes without extra efforts.

2025/02/23 12:00 AM