express breaking changes

npm

5 curated breaking changes across major versions of express. Use this as a migration checklist before bumping dependencies.

5
changes
Breaking changes by transition
  • 4 \u2192 5api

    path-to-regexp upgraded to 8.x: wildcards now require an explicit name (e.g. `/files/*filepath` instead of `/files/*`).

    Migration

    Update route patterns: `/assets/*` -> `/assets/*assetPath`. Regex routes unchanged.

  • 4 \u2192 5behavior

    req.body is `undefined` by default when no body-parsing middleware matches (was `{}` in 4.x).

    Migration

    Guard with `req.body ?? {}` or mount `express.json()` / `express.urlencoded()` as needed.

  • 4 \u2192 5behavior

    Async middleware: rejected promises propagate to the error handler automatically.

    Migration

    You can now `throw` or reject inside async middleware without try/catch. Remove manual `.catch(next)` wrappers.

  • 4 \u2192 5removal

    `req.param(name)` removed (deprecated in 4.x). `app.del` alias removed.

    Migration

    Use `req.params.name`, `req.body.name`, or `req.query.name` explicitly. Rename `app.del` to `app.delete`.

  • 4 \u2192 5runtime

    Node.js 18+ required.

    Migration

    Upgrade Node to >= 18 before installing express@5.

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/npm/express
express breaking changes — npm migration guide | DepScope