Hey guys, I’m new to Cloudflare and Wrangler, so I apologize in advance if I have misunderstood anyt

Hey guys,
I’m new to Cloudflare and Wrangler, so I apologize in advance if I have misunderstood anything. I’m trying to deploy my Next.js website using Cloudflare Pages, so to build/deploy I'm using the @cloudflare/next-on-pages@1 package. This requires me to add a
wrangler.toml
file to my project root as it complained about a missing nodejs_compat flag I needed to set, which I have done in the wrangler config.

name = "<PROJECT_NAME>"
compatibility_date = "2024-11-22"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"


However, every time I try to deploy my site, I encounter the following issue:

21:46:32.059  Found wrangler.toml file. Reading build configuration...
21:46:32.064  pages_build_output_dir: .vercel/output/static
21:46:32.065  Build environment variables: (none found)
21:46:32.162  Successfully read wrangler.toml file.
21:46:32.300  Detected the following tools from environment: npm@9.6.7, nodejs@18.17.1
21:46:32.300  Installing project dependencies: npm clean-install --progress=false
21:46:33.815  npm WARN EBADENGINE Unsupported engine {
21:46:33.815  npm WARN EBADENGINE   package: 'next@15.0.3',
21:46:33.815  npm WARN EBADENGINE   required: { node: '^18.18.0 || ^19.8.0 || >= 20.0.0' },
21:46:33.816  npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
21:46:33.816  npm WARN EBADENGINE }
...
21:47:03.417  npm WARN EBADENGINE Unsupported engine {
21:46:33.417  npm WARN EBADENGINE   package: 'next@15.0.3',
21:46:33.417  npm WARN EBADENGINE   required: { node: '^18.18.0 || ^19.8.0 || >= 20.0.0' },
21:46:33.418  npm WARN EBADENGINE   current: { node: 'v18.17.1', npm: '9.6.7' }
21:47:04.782  You are using Node.js 18.17.1. For Next.js, Node.js version "^18.18.0 || ^19.8.0 || >= 20.0.0" is required.
21:47:04.798  Error: Command "npm run build" exited with 1
Was this page helpful?