Forge lint/deploy issue with Node.js 22

After upgrading from Node.js 22, Forge commands started failing.

During the lint/deploy process, Forge tries to fetch Atlassian OpenAPI files and fails with the following error:

Error: Invalid response body while trying to fetch
https://developer.atlassian.com/cloud/confluence/openapi-v2.v3.json:
Premature close

Because of this, the Forge lint/deploy step becomes unreliable and fails intermittently.

The same setup was working with Node.js 22.6.0 on local environment but fails on staging/production.

  1. The issue appears related to Forge fetching Atlassian internal OpenAPI definitions during lint/deploy.
  2. Need confirmation whether this is a Node.js 22 compatibility issue or a Forge CLI issue.

Hey @FaiyajSarjekhan,

I saw the same thing once this morning on Node 24. I don’t think it’s related to your Node version. After a few retries, I didn’t see it repeat so I didn’t report anything. If you (or anyone finding this thread) do find this to be a repeatable (or frequent) problem, please report through developer support:

Hey @FaiyajSarjekhan

Please see this response on another thread - "forge build" command starting to fail with "invalid json response..." error - #16 by XavierCaron

TLDR - The issue relates to Nodejs itself. Using a previous version fixes the problem. On Forge side, we will be looking at migrating away from node-fetch which will be a proper solution.

Cheers