canirequire

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

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
License
MIT

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.

Runtimerequire("@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.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).

VersionsFormatFirst published
3.0.0 – 3.0.2ESM-onlyAug 11, 2026
2.27.0 – 2.31.1Dual (CommonJS + ESM)Nov 28, 2023
2.11.2 – 2.26.2CommonJSOct 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

Similar popularity