Wrangler "requires at least Node.js" version in CI
Wrangler refuses to run on a Node.js version older than it supports. In CI the runner may default to an older Node than your machine, so pin a supported version with setup-node before invoking Wrangler.
What this error means
The deploy step fails at startup with "Wrangler requires at least Node.js v18.0.0" (or similar) and never reaches the deploy.
Error: Wrangler requires at least Node.js v18.0.0. You are using v16.20.2.
Please update your version of Node.js.Common causes
The runner Node is older than Wrangler supports
A default or pinned older Node on the runner is below Wrangler's minimum, so it exits before doing anything.
No explicit Node version in the workflow
Without setup-node, the job uses whatever Node the image ships, which may lag behind Wrangler's requirement.
How to fix it
Pin a supported Node with setup-node
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}Match Node to the Wrangler version
Check the minimum Node your Wrangler version requires and pin at or above it, ideally an active LTS.
How to prevent it
- Always pin Node with setup-node in deploy workflows.
- Use an active LTS Node that satisfies Wrangler.
- Bump the pinned Node when upgrading Wrangler.