Upgrading Node.js to 22 on macOS Sequoia
Use Homebrew’s keg-only node@22, force the symlink, and pin PATH in zsh

⚡ Next.js Implementation Guides
In-depth Next.js guides covering App Router, RSC, ISR, and deployment. Get code examples, optimization checklists, and prompts to accelerate development.
I was building a Next.js 15 project on my MacBook when the production build died with a warning: Node 19.3.0 no longer meets the runtime floor. After a bit of digging—and a reminder that macOS Sequoia ships with an older /usr/local/bin/node
—I landed on a clean upgrade path. This guide walks you through upgrading to Node 22 with Homebrew and making sure zsh always picks it first, which also keeps your local runtime aligned with Vercel’s current defaults.
Confirm the runtime Next.js is using
The first thing I did was double-check the version Next.js pulled at build time. If your shell still resolves the legacy binary, the build will fail long before you reach the fix.
# Terminal
node -v
If the command echoes v19.3.0
, your session is hitting the historic /usr/local/bin/node
that ships with older Homebrew installs. Keep that value in mind—we’ll use it as the baseline the next time we verify the PATH.
Install Node 22 from Homebrew
Homebrew hosts a keg-only node@22
formula that plays nicely alongside any older runtimes. Installing it on macOS Sequoia pulls in the updated TLS certificates and HTTP/3 dependencies that Node 22 expects by default. Vercel’s runtime matrix only exposes major versions 22.x (default) and 20.x, rolling minor updates automatically, so upgrading locally keeps parity with what your serverless functions will run in production. See the Vercel Node.js runtime documentation for the full support table.
# Terminal
brew install node@22
Homebrew stages the binary under /opt/homebrew/Cellar/node@22/22.x.y
and leaves it keg-only, which means it does not automatically take precedence over the legacy executable. The next step fixes that.
Force macOS Sequoia to prefer the new keg
Because the legacy binary still lives in /usr/local/bin
, I needed to point the system-wide symlink at the fresh Node 22 keg. Using the --overwrite
and --force
flags ensures the old symlink does not linger.
# Terminal
brew link --overwrite --force node@22
With the symlink in place, /opt/homebrew/bin/node
resolves to Node 22. However, many Sequoia setups still put /usr/local/bin
ahead of Homebrew in the PATH, so the next step hard-pins the newer binary for every zsh login.
Persist Node 22 in zsh
To keep the environment consistent, I added the Homebrew keg’s bin directory to my ~/.zshrc
. This guarantees that any future terminal—including those spawned by IDEs—prefers Node 22 before it finds the older fallback.
# File: ~/.zshrc
export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
Place this line near your other PATH exports so the order stays predictable. When zsh re-evaluates the file, it prepends the Node 22 keg directory, locking in the upgrade for every session.
Reload your shell and check Next.js
Finally, reload the shell so the updated PATH takes effect and confirm the runtime before re-running the Next.js build.
# Terminal
zsh -lic 'node -v'
This command launches a fresh login shell, sources ~/.zshrc
, and prints the Node version that Next.js will see. Once it returns v22.20.0
(or a newer 22.x release), you can confidently re-run pnpm run build
without tripping the runtime warning.
Upgrading the runtime fixed the build blockers immediately: Next.js relied on modern Web Streams support that only ships in Node 19.8.0 and above, and Node 22 brings those APIs plus better performance across the board. It also means local builds now match Vercel’s default 22.x environment, avoiding discrepancies between development and deployment.
By upgrading Homebrew’s Node keg, forcing the symlink, and persisting the PATH update in zsh, you ensured macOS Sequoia pulls the right binary every time. You can now compile your Next.js app with Node 22 without fighting legacy tooling. Let me know in the comments if you have questions, and subscribe for more practical development guides.
Thanks, Matija