This repository was archived by the owner on Jan 22, 2026. It is now read-only.
fix: support older node version than 22.12.0#348
Merged
Conversation
- add NODE_OPTIONS="--experimental-require-module" to support some modules in the locale generation process - make the engine (and package manager) field strict with .npmrc
oae
approved these changes
Feb 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In #342 (8829de8 and 8a99348) I updated some dependencies, that our locale generation script uses. The updates made them ESM only. I used node v22.14.0 and I didn't notice any problem. But after investigating a failure reported in #347 I found out, that that broke support for older node version than 22.12.0. The reason for this is the following timeline:
--experimental-require-moduleflag added, defaultfalse--experimental-require-moduleflag added, defaultfalse--experimental-require-moduleflag defaults totrueThe flag
--experimental-require-modulemakesrequire()calls also support ESM modules, which we need, if we want to use the newest versions of some dependencies.This feature is under active development, but it's stable in the LTS branches of node
So to fix this issue, I added
NODE_OPTIONS='--experimental-require-module'in front of every ts-node call. I also guarded everything with an explicitenginesfield in the package.json. So we support only the node versions, where this feature can be enabled. I made the engines field strict, so that it can't be circumvented.This shouldn't introduce problems, as we use node 22 in actions anyway, and we just use this to generate locales.
Fixes #347
Type of change
Checklist