Got ERR_REQUIRE_ESM when using the CLI, below is part of the error.
...
const ora_1 = __importDefault(require("ora"));
Error [ERR_REQUIRE_ESM]: require() of ES Module <paths_in_my_file_system>\node_modules\ora\index.js from <paths_in_my_file_system>\node_modules\@better-auth-cloudflare\cli\dist\index.js not supported.
...
Apparently this is caused by the ora package not supporting being imported from a commonjs project using require: sindresorhus/ora#239
I'm able to run the cli using node v24, and v20.19.5, likely due to this: https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require, and I suspect it might work with some older versions with the --experimental-require-module flag.
Given that the feature was only added roughly one year ago, I think it's worth adding a line in the docs reminding people to update their node if they are having this error when using the CLI.
And thanks for this plugin!
Got ERR_REQUIRE_ESM when using the CLI, below is part of the error.
Apparently this is caused by the
orapackage not supporting being imported from acommonjsproject usingrequire: sindresorhus/ora#239I'm able to run the cli using node v24, and v20.19.5, likely due to this: https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require, and I suspect it might work with some older versions with the
--experimental-require-moduleflag.Given that the feature was only added roughly one year ago, I think it's worth adding a line in the docs reminding people to update their node if they are having this error when using the CLI.
And thanks for this plugin!