Error: Found invalid Node.js Version: "18.x"

Our SvelteKit web app package.json (located at packages/webapp in a monorepo) contains the following:

"engines": {
  "node": "18.x"
},

All of a sudden two days ago, builds started to fail with the following error:

Error: Found invalid Node.js Version: "18.x". Please set "engines": { "node": "22.x" } in your `package.json` file to use Node.js 22.

Our Vercel project settings also specify Node.js 18, although that’s irrelevant since the value in package.json takes precedence. We also have a root-level package.json which specifies the following:

  "engines": {
    "node": ">=18",
    "pnpm": "9.4.0 || >=9.7.0"
  },

I expect this to be irrelevant as well since the root directory for the webapp project in Vercel is set to packages/webapp.

I also have an open support case #311491, but there’s been radio silence for the last 15 hours, hence I’m posting here to see if the community can help.

Hi,

Can you share your vercel.json and package.json file? If you are using monorepo, please share your root vercel.json as well.

1 Like

First, I want to try to get you unstuck as quickly as possible with a temporary workaround. You may be able to deploy from local build with the --prebuilt flag.

As @swarnava mentioned, the vercel.json and package.json would tell us more about the configuration settings for the project.

2 Likes

You’re already getting help from the very best, but wanted to say - hi @mikenikles! Nice to see you here :smile:

2 Likes

We don’t have a vercel.json file. As for the root-level and packages/webapp package.json files, is there anything other than what I share that you need?

Our GitHub workflow step to deploy the web app is:

  deploy-webapp-dev:
    runs-on: ubuntu-latest

    environment:
      name: webapp-dev
      url: https://dev.redacted.com

    defaults:
      run:
        working-directory: .

    steps:
      - uses: actions/checkout@v4

      # using a fork of amondnet/vercel-action for now until it is updated for node20
      - uses: vincent8balls/vercel-action@master
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required
          scope: <redacted>
          vercel-project-name: webapp

The support ticket (#311491) contains a link to one of the deployments that failed in case that provides more context. The specific deployment is 6oem3zGWUR8tZebqUDhriR66y9A9

Hi Pauline :wave: :slight_smile:!

1 Like

Yes we will need the whole package.json file. I believe one of your packages is somehow overriding our Nodeversion preference. Are you using any custom builder or zero config deployment?

Can you share a reproducible steps?

1 Like

Unfortunately, this is not an open source project and I can’t share the entire package.json files. However, before we go down the path of sharing a reproducible of an enterprise application, can you confirm that Node.js 22 LTS is now generally available for builds and functions - Vercel is not the cause of our failed builds?

You announced Node.js 22 support on November 22. The first deployment we did after that announcement failed with an error telling us to upgrade to Node.js 22.

Once you confirm this is not the problem of our failed builds, I’ll be able to justify the time investment to create a reproducible project.

I appreciate your help so far, as this is more than the radio silence I’ve gotten from the support ticket.

It appears that my colleague, Anna, has already identified the problem and responded via ticket. This was related to the outdated Sveltekit adapter that was unaware of the latest Node version. Please let us know if you have any questions.

1 Like

For anyone else who ends up here in the future: If you have a monorepo with a package.json at the root-level and one at packages/xyz, the root-level file is used to determine the Node.js engine. A few other facts that apply to this:

  • The Vercel project’s root dir is set to packages/xyz
  • The install command runs at the root
5 Likes

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