Node.js version mismatch for Next.js build&deploy from git

20:48:47.062 | ▲ 147 packages are looking for funding
-- | --
20:48:47.062 | ▲ run `npm fund` for details
20:48:47.072 | ▲ Detected Next.js version: 15.1.7
20:48:47.077 | ▲ Running "npm run build"
20:48:47.421 | ▲ > [email protected] build
20:48:47.422 | ▲ > next build
20:48:47.559 | ▲ 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.
20:48:47.577 | ▲ Error: Command "npm run build" exited with 1
20:48:47.742 |  
20:48:47.742 | ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
20:48:47.742 | ⚡️ If you need help solving the issue, refer to the Vercel or Next.js documentation or their repositories.
20:48:47.743 |  
20:48:47.785 | Failed: Error while executing user command. Exited with error code: 1
20:48:47.793 | Failed: build command exited with code: 1
20:48:48.881 | Failed: error occurred while running build command
20:48:47.062 | ▲ 147 packages are looking for funding
-- | --
20:48:47.062 | ▲ run `npm fund` for details
20:48:47.072 | ▲ Detected Next.js version: 15.1.7
20:48:47.077 | ▲ Running "npm run build"
20:48:47.421 | ▲ > [email protected] build
20:48:47.422 | ▲ > next build
20:48:47.559 | ▲ 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.
20:48:47.577 | ▲ Error: Command "npm run build" exited with 1
20:48:47.742 |  
20:48:47.742 | ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
20:48:47.742 | ⚡️ If you need help solving the issue, refer to the Vercel or Next.js documentation or their repositories.
20:48:47.743 |  
20:48:47.785 | Failed: Error while executing user command. Exited with error code: 1
20:48:47.793 | Failed: build command exited with code: 1
20:48:48.881 | Failed: error occurred while running build command
Due to the version mismatch, we could not deploy the application with cloudflare. I have made a project on MacOS, uploaded(pushed) to git, and tried to build&deploy on CloudFlare without any environment setting changes. build code : npx @cloudflare/next-on-pages@1 (default value)
3 Replies
siliconsjang
siliconsjangOP6d ago
Looks like build image on cloudflare (runtime v2) is using Node.js 18.17.1, this might be needed to be upgraded?
siliconsjang
siliconsjangOP5d ago
ooh there was a variable. didn't got that before. thanks!

Did you find this page helpful?