canirequire › ESM-only › @changesets/cli
Is @changesets/cli ESM-only? Can you require() it?
A tool to manage versioning and changelogs with a focus on monorepos
Last verified Sep 9, 2026 against @changesets/cli@3.0.2. JSON
ESM-only ESM-only since 3.0.0 — last CommonJS version is 2.31.1
@changesets/cli dropped its CommonJS build in 3.0.0 (August 2026). The last version you can require() on every Node.js version, including 18 and older, is 2.31.1, published Jul 15, 2026.
require("@changesets/cli") fails even on Node.js 20.19+ / 22.12+ because the package uses top-level await, which require(esm) cannot load. Use import() instead.
@changesets/cli@3.0.2 declares engines "^22.11 || ^24 || >=26", so Node.js 18, 20 are outside its supported range regardless of module format.
Does @changesets/cli@3.0.2 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@changesets/cli") from a CommonJS file and import "@changesets/cli" from an ES module.
| Runtime | require("@changesets/cli") | import "@changesets/cli" |
|---|---|---|
| Node.js 18 | ✗ failsERR_REQUIRE_ESM | ✗ failsSyntaxError |
| Node.js 20 | ✗ failsERR_REQUIRE_ASYNC_MODULE | ✗ fails |
| Node.js 22 | ✗ failsERR_REQUIRE_ASYNC_MODULE | ✗ fails |
| Node.js 24 | ✗ failsERR_REQUIRE_ASYNC_MODULE | ✗ fails |
| Node.js 26 | ✗ failsERR_REQUIRE_ASYNC_MODULE | ✗ fails |
| Bun 1.4 | ✗ failsTypeError | ✗ fails |
How to import @changesets/cli
ES modules (import)
import cli from "@changesets/cli";CommonJS (require)
// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const cli = require("@changesets/cli");
// Any Node.js version:
const cli = await import("@changesets/cli");
// Or pin the last CommonJS release:
// npm install @changesets/cli@2.31.1Module format by version
Derived from the type, main and exports fields of every stable release on npm (109 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 3.0.0 – 3.0.2 | ESM-only | Aug 11, 2026 |
| 2.27.0 – 2.31.1 | Dual (CommonJS + ESM) | Nov 28, 2023 |
| 2.11.2 – 2.26.2 | CommonJS | Oct 30, 2020 |
Frequently asked
Is @changesets/cli ESM-only?
@changesets/cli@3.0.2 is ESM-only. @changesets/cli dropped its CommonJS build in 3.0.0 (August 2026). The last version you can require() on every Node.js version, including 18 and older, is 2.31.1, published Jul 15, 2026.
Which version of @changesets/cli still supports CommonJS / require()?
2.31.1 is the last version of @changesets/cli with a CommonJS build. Install it with "npm install @changesets/cli@2.31.1". Every version from 3.0.0 on is ESM-only.
How do I use @changesets/cli from a CommonJS file?
Use a dynamic import: const mod = await import("@changesets/cli"). On Node.js 20.19+, 22.12+ and newer, a plain require("@changesets/cli") also works for ESM packages that do not use top-level await. Alternatively pin @changesets/cli@2.31.1.
Does @changesets/cli work in Bun?
Importing @changesets/cli failed in Bun 1.4 on Sep 9, 2026.
Does @changesets/cli ship TypeScript types?
No. @changesets/cli ships no type declarations and there is no @types package for it.
Links
Other esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - tslib 2.8.1last CJS
2.5.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1
Similar popularity
- @ant-design/icons 6.3.4Dual
- @angular/platform-browser-dynamic 22.1.5ESM-only
- @angular-devkit/build-angular 22.1.7CommonJS
- @oclif/plugin-help 7.0.0ESM-only
- @rollup/plugin-typescript 12.3.0Dual
- @fortawesome/fontawesome-svg-core 7.3.1Dual
- @rollup/plugin-alias 6.0.0ESM-only
- @fortawesome/free-solid-svg-icons 7.3.1Dual