This Node.js version cannot require() ES modules
CommonBefore v22.12.0 (v20.19.0 on the 20 line), require() of an ES module always fails, typically after a dependency upgrade to an ESM-only major version.
Confirm
node -v
A version older than 22.12.0 or 20.19.0
Fix
- Upgrade Node.js to a supported line where require(esm) works (22.12+, 24 or later).
- Or load the module with import(): const { thing } = await import("pkg") inside an async function.
- Or stay on the dependency's last CommonJS major version for now, and plan the move.