npm90% confidence\u2191 31
Error [ERR_REQUIRE_ESM]: require() of ES Module
Full error message
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/file.js from /caller not supported.
Solutionsource: internal \u2197
You're require()-ing a package that ships ESM only. 1. Convert the caller to ESM (`"type": "module"` in package.json + use `import`). 2. If on Node 22.12+, require(ESM) now works automatically (no flag). 3. Use dynamic import in CJS: `const mod = await import('esm-only-pkg')`.
API access
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/96a9789ddef81db92dceaf48487edbbccc4dc83a66746ea21a158c5d1162b32fhash \u00b7 96a9789ddef81db92dceaf48487edbbccc4dc83a66746ea21a158c5d1162b32f