# Is @changesets/cli ESM-only? Can you require() it?

> @changesets/cli@3.0.2 is ESM-only. ESM-only since 3.0.0 — last CommonJS version is 2.31.1.

A tool to manage versioning and changelogs with a focus on monorepos

Last verified Sep 9, 2026 against @changesets/cli@3.0.2.

@changesets/cli dropped its CommonJS build in 3.0.0 (August 2026). The last version with a plain require()-able CommonJS entry is 2.31.1, published Jul 15, 2026.

require("@changesets/cli") fails even on Node.js 22.12+ and newer: the package uses top-level await, which require(esm) cannot load (ERR_REQUIRE_ASYNC_MODULE). Use import() instead. Node.js 18 has no require(esm), and @changesets/cli@3.0.2 declares Node.js ^22.11 || ^24 || >=26, so 18 is outside its supported range anyway.

@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.

## What to do

1. require("@changesets/cli") fails even on Node.js 22.12+ and newer: the package uses top-level await, which require(esm) cannot load (ERR_REQUIRE_ASYNC_MODULE). Use import() instead.
2. From a CommonJS file, use a dynamic import inside an async function: const cli = await import("@changesets/cli"). That works on every Node.js version the package supports (^22.11 || ^24 || >=26).
3. If you need a synchronous require() or run Node.js 18: npm install @changesets/cli@2.31.1, the last CommonJS release (published Jul 15, 2026).
4. @changesets/cli@3.0.2 declares engines "^22.11 || ^24 || >=26", so Node.js 18, 20 are unsupported regardless: upgrade Node.js or pin an older release.
5. TypeScript: no types are available for @changesets/cli; declare the module yourself if you need them.

## Facts

- Latest: 3.0.2 (Sep 4, 2026)
- Module format: ESM-only
- Last CommonJS version: 2.31.1
- ESM-only since: 3.0.0 (Aug 11, 2026)
- TypeScript types: none
- Node engines: ^22.11 || ^24 || >=26
- Weekly downloads: 3.4M
- License: MIT

## Runtime test results for @changesets/cli@3.0.2

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 | fails (ERR_REQUIRE_ESM) | fails (SyntaxError) |
| Node.js 20 | fails (ERR_REQUIRE_ASYNC_MODULE) | fails (Error) |
| Node.js 22 | fails (ERR_REQUIRE_ASYNC_MODULE) | fails (Error) |
| Node.js 24 | fails (ERR_REQUIRE_ASYNC_MODULE) | fails (Error) |
| Node.js 26 | fails (ERR_REQUIRE_ASYNC_MODULE) | fails (Error) |
| Bun 1.4.0 | fails (TypeError) | fails (Error) |

## How to import @changesets/cli

ES modules:

```js
import * as cli from "@changesets/cli";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
// Node.js 22.12+ and newer cannot require() this package: it uses top-level await.

// Any Node.js version the package supports (^22.11 || ^24 || >=26), from an async function:
async function main() {
  const cli = await import("@changesets/cli");
}

// Or pin the last CommonJS release:
// npm install @changesets/cli@2.31.1
```

## Module 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 with a plain require()-able CommonJS entry 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?**

From a CommonJS file, use a dynamic import inside an async function: const cli = await import("@changesets/cli"). That works on every Node.js version the package supports (^22.11 || ^24 || >=26). require("@changesets/cli") fails even on Node.js 22.12+ and newer: the package uses top-level await, which require(esm) cannot load (ERR_REQUIRE_ASYNC_MODULE). Use import() instead. Alternatively pin @changesets/cli@2.31.1.

**Does @changesets/cli work in Bun?**

Importing @changesets/cli failed in Bun 1.4.0 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

- [@changesets/cli on npm](https://www.npmjs.com/package/@changesets/cli)
- [Source repository](https://github.com/changesets/changesets)
- [HTML version](https://canirequire.com/package/@changesets/cli/)
- [JSON version](https://canirequire.com/package/@changesets/cli.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
