node breaking changes

npm

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

5
changes
Breaking changes by transition
  • 20 \u2192 22api

    `node --watch` is stable (no flag needed).

    Migration

    Replace `nodemon` with `node --watch index.js` for simple use cases.

  • 20 \u2192 22api

    Built-in WebSocket client (no `ws` package needed for simple clients).

    Migration

    `const ws = new WebSocket('wss://...')` works natively. Use `ws` package for server-side still.

  • 20 \u2192 22runtime

    require(ESM) is supported (synchronous require of ES modules without top-level await).

    Migration

    Works without flag since 22.12. For 22.0-22.11 use `--experimental-require-module`. TLA modules still cannot be required.

  • 18 \u2192 20api

    Built-in `--env-file` flag: load .env without dotenv.

    Migration

    Run `node --env-file=.env index.js`. Still use dotenv if you need variable interpolation.

  • 18 \u2192 20runtime

    V8 upgraded to 11.3; some older native addons may need rebuild.

    Migration

    Run `npm rebuild` after upgrading. Watch for `NODE_MODULE_VERSION` mismatches in native packages.

API access

Get this data programmatically \u2014 free, no authentication.

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