When using any forge command (e.g. forge --version) in a node environment using the latest LTS version v22.11.0 we get the following warning message:
(node:67301) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Warning: Forge CLI supports Node.js 18.x or 20.x.
Unsupported Node.js versions are not guaranteed to work correctly.
I am using version 10.12.0 of the @forge/cli package installed using npm.
Is there a roadmap when forge CLI will start supporting Node.js 22?
We are currently using forge CLI commands inside docker containers that come with Playwright for e2e testing. The environment inside those docker containers was upgraded to Node.js 22 with @playwright/test v1.49.0. This appears to have broken our setup.
Thanks for the info. We are looking forward to the update!
Just to make sure we are on the same page: I am not talking about the node runtime version specified in our app’s manifest.yml. Presumably that refers to the version used for executing forge backend calls inside AWS Lambdas.
Instead I am talking about the node version installed on my local machine when executing CLI commands like forge deploy.
I can see that it might make sense for you guys to update the supported node versions for both of these scenarios simultaneously though.
Any updates on this?
Looks like the @forge/cli package still only supports Node major versions 18 and 20.
Via @forge/cli - npm you can see that in the currently released version, the file /@forge/cli/out/command-line/version-info.js contains the following on line 23: const supportedNodeMajorVersions = [18, 20];
@LucyChen@Benny I am trying to run e2e tests in CI, which invoke the Forge CLI. Those tests run on the latest LTS version, but the CLI complains that it only likes node 20 and 22 (not 24, which is the latest LTS).
The warnings are annoying because they also get printed when we run forge install list --json. This does, in fact, return the list of installations, but parsing the JSON fails because the Forge CLI prints the following warning together with the JSON output: Warning: Forge CLI supports Node.js 20.x or 22.x. Unsupported Node.js versions are not guaranteed to work correctly.
This check for in the CLI for supported Node.js versions is intended to keep CLI aligned with the node runtimes that are available, and to warn when users are running Node versions that haven’t been validated with the current CLI release. Node 24 was recently added as an available runtime so we are working through testing at the moment and planning on adding to the supportedNodeMajorVersions soon.
I agree these kinds of warnings should be directed to stderr instead of stdout so this doesn’t break commands with --json, I’ve raised bug ticket for this here https://jira.atlassian.com/browse/ECO-1233, please vote or comment if you have additional input.