Node.js Version Conflict During Deployment

I saw the announcement that Node.js 18 will no longer be supported after September 1st, so I upgraded to a newer version. I’ve set up my project to use Node.js version 22.0, but I keep getting deployment errors despite multiple attempts. The error message I’m receiving indicates that I need to set the Node.js version to 18.0, even though I’ve already tried versions 20.0 and 22.0.

Here are the deployment details:
Error: Found invalid Node.js Version: “22.x”. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.

Even if I set engines in my package.json to >=18.0.0, I still get the Error: spawn npm ENOENT message. Here are the version dependencies for my other packages:

  • Vite (Main build tool)
    • Version: 5.4.19
    • Requirement: "node": "^18.0.0 || >=20.0.0"
    • Status: :white_check_mark: Compatible - Supports Node.js 20.x
  • ESLint-related packages (multiple packages)
    • Includes: @eslint/js, @eslint/core, @eslint/config-helpers, etc.
    • Requirement: "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
    • Status: :white_check_mark: Compatible - Supports Node.js 20.x
  • TypeScript ESLint-related packages
    • Includes: typescript-eslint, @typescript-eslint/, etc.
    • Requirement: "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
    • Status: :white_check_mark: Compatible - Supports Node.js 20.x

In addition, on August 27th, I was able to successfully deploy using Node.js version 18.0.

I’ve found the reason. The line "runtime": "@vercel/node@3.0.0" in my Vercel configuration is causing it to use Node.js version 18.0.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.