From 2b8c7e8d9a318b0dfa13d472a5a80397e44b60e8 Mon Sep 17 00:00:00 2001 From: yyovil Date: Thu, 2 Apr 2026 00:08:50 +0530 Subject: [PATCH] Reverted back to createRequire method instead of static imports in ESM because of compatibility issues with node < v20.10.0 --- packages/cli/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 3d3855800..d721b19b8 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import { Command } from "commander"; -import packageJson from "../package.json" with { type: "json" }; +import { createRequire } from "node:module"; import { registerInit } from "./commands/init.js"; import { registerStatus } from "./commands/status.js"; import { registerSpawn, registerBatchSpawn } from "./commands/spawn.js"; @@ -19,6 +19,8 @@ import { registerSetup } from "./commands/setup.js"; import { registerPlugin } from "./commands/plugin.js"; import { getConfigInstruction } from "./lib/config-instruction.js"; +const require = createRequire(import.meta.url); +const packageJson = require("../package.json") as { version: string }; const program = new Command(); program