Error Code Portal
Node.jsNode.jsError code

ERR_REQUIRE_ESM

require esm

Code ERR_REQUIRE_ESM · An issue reported by Node.js.

An attempt was made to require() an ES Module. This error has been deprecated since require() now supports loading synchronous ES modules. When require() encounters an ES module that contains top-level await, it will throw ERR_REQUIRE_ASYNC_MODULE instead.

Troubleshooting and diagnostic links

First check that the document's product, version, and environment match your situation.