Skip to content

Commit 4c89d2a

Browse files
authored
Add troubleshooting instructions for ERR_REQUIRE_ESM (#43)
1 parent b5e2bfb commit 4c89d2a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ npx @better-auth-cloudflare/cli@latest migrate --migrate-target=prod # Non-int
103103

104104
The CLI creates projects from Hono or Next.js templates and can automatically set up D1, KV, R2, and Hyperdrive resources. See [CLI Documentation](./cli/README.md) for full documentation and all available arguments.
105105

106+
**Troubleshooting**:
107+
108+
If you encounter this error when using the CLI: `...Error [ERR_REQUIRE_ESM]: require() of ES Module...`, make sure your node version is at least `v23.0.0`, `v22.12.0`, or `v20.19.0`, depending on the major version you use. Read more [here](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require)
109+
106110
## Manual Installation
107111

108112
```bash

cli/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ npx @better-auth-cloudflare/cli migrate --migrate-target=dev
186186

187187
Creates a new Better Auth Cloudflare project from Hono or OpenNext.js templates, optionally creating Cloudflare D1, KV, R2, or Hyperdrive resources for you. The migrate command runs `auth:update`, `db:generate`, and optionally `db:migrate`.
188188

189+
## Troubleshooting
190+
191+
**Error `...Error [ERR_REQUIRE_ESM]: require() of ES Module...`**:
192+
193+
Loading ECMAScript modules using `require()` should be supported by your nodejs.
194+
Make sure your node version is at least `v23.0.0`, `v22.12.0`, or `v20.19.0`, depending on the major version you use.
195+
Read more [here](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require)
196+
189197
## Related
190198

191199
- 📦 **[better-auth-cloudflare](https://github.com/zpg6/better-auth-cloudflare)** - Main package and documentation

0 commit comments

Comments
 (0)