From fff3ebf9a33194af98d1c90b7743b416fe81c2d0 Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 31 Oct 2026 21:10:09 +0100 Subject: [PATCH] fix(cli): require Node.js 20.19+ or 22.12+ and say so instead of crashing with ERR_REQUIRE_ESM --- bin/config-sync | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/config-sync b/bin/config-sync index 0c15c08..3c6ca04 100644 --- a/bin/config-sync +++ b/bin/config-sync @@ -2,4 +2,11 @@ 'use strict'; +// The CLI loads ES-module-only dependencies (chalk, inquirer) with require(), +// which Node.js supports from 20.19 and 22.12 on. +if (!process.features.require_module) { + console.error(`config-sync: the CLI needs a Node.js that can require() ES modules: 20.19+ or 22.12+ (current: ${process.version}).`); + process.exit(1); +} + require('../dist/cli'); diff --git a/package.json b/package.json index d85d0d3..a7c677e 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ }, "homepage": "https://www.pluginpal.io/plugin/config-sync", "engines": { - "node": ">=20.0.0 <=24.x.x", + "node": "^20.19.0 || >=22.12.0 <=24.x.x", "npm": ">=6.0.0" }, "license": "MIT",