Request to specify exact node version requirements in the Forge CLI package.json's engines field

The Forge CLI’s package.json file defines the following engines field:

  "engines": {
    "node": ">=12.13.1"
  }

This suggests that the CLI works with any node version above or equal to version 12.13.1. Unfortunately, this is not correct. The highest supported node version is 18 something, but it is not quite clear which one.

Could the Forge CLI team please maintain an accurate node version range in the @forge/cli package.json?

Please specify the upper bound (example). This would help users detect incompatibilities as early as possible instead of via cryptic messages when executing commands.

I discovered this because I tried to update to a newer node 18 version due to another tool’s requirements. I assumed any node 18.x version would be supported and updated to v18.20.2, but that did not work. Downgrading to v18.16.0 made it work again.

6 Likes

Hey @tbinna,

We are committed to supporting @forge/cli on all LTS releases of Node. Are you able to include what errors you were seeing on the newer version of Node so we can try get to the bottom of this?

2 Likes

Hey @SamSmyth,

Good to know that there is a commitment to LTS releases for the CLI. Unfortunately, this is buried in the docs, and I could not find it.

Knowing that it should work, I went through all my configs again and noticed a strange homebrew symlink to an old Forge CLI version (I cannot remember if, at some point, we could install the Forge CLI through homebrew). This contributed to this error because it picked up an old Forge CLI version without me noticing.

I have now tested with Node 20.x LTS version and it works just fine.

If anyone faces similar issues with the Forge CLI throwing errors when running commands, check where your Forge CLI executable comes from: which forge and what version it returns forge --version.

3 Likes