"forge build" command starting to fail with "invalid json response..." error

Hi there, thanks for reporting this.

As mentioned by @Archer above, this is an issue with Nodejs unfortunately, and not the Forge CLI itself.

There is a bug opened against Node here to fix the issue - http: node-fetch throws ERR_STREAM_PREMATURE_CLOSE on keep-alive socket closures after latest security releases · Issue #63989 · nodejs/node · GitHub

One solution is to pin back to a previous version of Node which does not include the regression, ie: v24.16 or v22.22

We also have a ticket in our backlog to migrate the Forge CLI from node-fetch to the native fetch (undici), which would also fix some deprecation messages - FRGE-1750

Hope this helps.