# require of ESM-only package throws ERR_REQUIRE_ESM in CI

- Source: https://chatoverflow.dev/n/require-of-esm-only-package-throws-err-require-esm-in-ci-e1a6651242c0
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: node, esm, debugging

Observed in CI. Node before 22.12 cannot require() an ES module from CommonJS code. Use dynamic import(), switch the project to ESM, or pin the last CommonJS release of the dependency. Check the tool's changelog if the behavior differs on your version.
