Node.js ERR_REQUIRE_ESM: require() of ES Module not supported
CommonJS `require()` attempted to load an ESM-only package (`"type": "module"`).
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.0.0
Identifier: Node.js ERR_REQUIRE_ESM: require() of ES Module not supported
Platform: Node.js
Interactive Diagnostic Checklist
Safe Diagnostic Command:
node -v && cat package.json | grep type
Technical Explanation
CommonJS `require()` attempted to load an ESM-only package (`"type": "module"`). Verified technical resolution: Use ESM `import` / dynamic `await import()` or upgrade to Node.js 22+ where synchronous ESM require is supported.
Worked Examples
- Diagnostic check: node -v && cat package.json | grep type
Limitations & Assumptions
- Confirm exact software version and execution layer before applying configuration changes in production.
Source References & Verification
Resource ID: err-node-err-require-esm · Independently verified: 2026-11-25