fix: declare Node.js require(esm) engine range - #452
Open
huytdps13400 wants to merge 1 commit into
Open
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ERR_REQUIRE_ESMreact-native-node-apiCloses #110.
Compatibility evidence
The published host output contains
require("@react-native-node-api/cli-utils"), while CLI utils is an ESM package. Node’s module history enables this without a flag in Node 20.19.0 and 22.12.0.Running the same built
dist/node/cli/program.jsartifact:ERR_REQUIRE_ESMERR_REQUIRE_ESMERR_REQUIRE_ESMThis yields
>=20.19.0 <21 || >=22.12.0, while the root Node 24devEnginesremains unchanged for contributors.Test plan
pnpm --filter react-native-node-api test(61 passed)pnpm run buildpnpm run lintpnpm run prettier:checkpnpm run publint(all published packages pass strict validation)react-native-node-api@1.1.1and verified the tarball includes the engine range