We use @hubspot/cli-lib as an dependency in our internal tool to interact with HubSpot's public APIs. Up to @hubspot/cli-lib v7.0.0 everything works fine without any problems, but starting with @hubspot/cli-lib v8.0.0 everything stops working with this error :
Error [ERR_REQUIRE_ESM]: require() of ES Module …node_modules/@hubspot/local-dev-lib/lib/… not supported
Simplest way to reproduce the error:
- Create a simple node project
- Install
@hubspot/cli-lib as an npm dependency
- Create a
check.js file
- Add this line to the file:
import { downloadFileOrFolder } from '@hubspot/cli-lib/fileMapper.js'
- Run code
node check.js twice with @hubspot/cli-lib v5.0.1 and v8.0.0 as an dependency
- Works great with v5.0.1
- With version 8.0.0 we'll get an error
Tested with Node.js v18 and v20
Thanks in advance.
We use
@hubspot/cli-libas an dependency in our internal tool to interact with HubSpot's public APIs. Up to@hubspot/cli-libv7.0.0 everything works fine without any problems, but starting with@hubspot/cli-libv8.0.0everything stops working with this error :Error [ERR_REQUIRE_ESM]: require() of ES Module …node_modules/@hubspot/local-dev-lib/lib/… not supportedSimplest way to reproduce the error:
@hubspot/cli-libas annpmdependencycheck.jsfileimport { downloadFileOrFolder } from '@hubspot/cli-lib/fileMapper.js'node check.jstwice with @hubspot/cli-lib v5.0.1 and v8.0.0 as an dependencyTested with Node.js v18 and v20
Thanks in advance.