# Is semantic-release ESM-only? Can you require() it?

> semantic-release@25.0.9 is ESM-only. ESM-only since 20.0.0 — last CommonJS version is 19.0.5.

Automated semver compliant package publishing

Last verified Sep 9, 2026 against semantic-release@25.0.9.

semantic-release dropped its CommonJS build in 20.0.0 (January 2023). The last version with a plain require()-able CommonJS entry is 19.0.5, published Aug 23, 2022; it declares support for Node.js >=16 || ^14.17.

On Node.js 22.12+ and newer (semantic-release@25.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("semantic-release") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26. Node.js 18 has no require(esm), and semantic-release@25.0.9 declares Node.js ^22.14.0 || >= 24.10.0, so 18 is outside its supported range anyway.

semantic-release@25.0.9 declares engines "^22.14.0 || >= 24.10.0", so Node.js 18, 20 are outside its supported range regardless of module format.

## What to do

1. On Node.js 22.12+ and newer (semantic-release@25.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("semantic-release") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26.
2. From a CommonJS file, use a dynamic import inside an async function: const semanticRelease = await import("semantic-release"). That works on every Node.js version the package supports (^22.14.0 || >= 24.10.0).
3. If you need a synchronous require() or run Node.js 18: npm install semantic-release@19.0.5, the last CommonJS release (published Aug 23, 2022); it declares Node.js >=16 || ^14.17.
4. semantic-release@25.0.9 declares engines "^22.14.0 || >= 24.10.0", so Node.js 18, 20 are unsupported regardless: upgrade Node.js or pin an older release.
5. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 25.0.9 (Aug 5, 2026)
- Module format: ESM-only
- Last CommonJS version: 19.0.5
- ESM-only since: 20.0.0 (Jan 6, 2023)
- TypeScript types: bundled
- Node engines: ^22.14.0 || >= 24.10.0
- Weekly downloads: 2.1M
- License: MIT

## Runtime test results for semantic-release@25.0.9

Installed and executed on Sep 9, 2026 with require("semantic-release") from a CommonJS file and import "semantic-release" from an ES module.

| Runtime | require("semantic-release") | import "semantic-release" |
|---|---|---|
| Node.js 18 | fails (ERR_REQUIRE_ESM) | works |
| Node.js 20 | works | works |
| Node.js 22 | works | works |
| Node.js 24 | works | works |
| Node.js 26 | works | works |
| Bun 1.4.0 | works | works |

## How to import semantic-release

ES modules:

```js
import * as semanticRelease from "semantic-release";
```

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 (verified):
const semanticRelease = require("semantic-release");

// Any Node.js version the package supports (^22.14.0 || >= 24.10.0), from an async function:
async function main() {
  const semanticRelease = await import("semantic-release");
}

// Or pin the last CommonJS release (declares Node.js >=16 || ^14.17):
// npm install semantic-release@19.0.5
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (341 versions; the newest 60 shown).

| Versions | Format | First published |
|---|---|---|
| 21.0.2 – 25.0.9 | ESM-only | Apr 28, 2023 |

## Frequently asked

**Is semantic-release ESM-only?**

semantic-release@25.0.9 is ESM-only. semantic-release dropped its CommonJS build in 20.0.0 (January 2023). The last version with a plain require()-able CommonJS entry is 19.0.5, published Aug 23, 2022; it declares support for Node.js >=16 || ^14.17.

**Which version of semantic-release still supports CommonJS / require()?**

19.0.5 is the last version of semantic-release with a CommonJS build; it declares Node.js >=16 || ^14.17. Install it with "npm install semantic-release@19.0.5". Every version from 20.0.0 on is ESM-only.

**How do I use semantic-release from a CommonJS file?**

From a CommonJS file, use a dynamic import inside an async function: const semanticRelease = await import("semantic-release"). That works on every Node.js version the package supports (^22.14.0 || >= 24.10.0). On Node.js 22.12+ and newer (semantic-release@25.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("semantic-release") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26. Alternatively pin semantic-release@19.0.5 (declares Node.js >=16 || ^14.17).

**Does semantic-release work in Bun?**

Yes. import "semantic-release" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does semantic-release ship TypeScript types?**

Yes. semantic-release bundles its own type declarations; no @types package is needed.

## Links

- [semantic-release on npm](https://www.npmjs.com/package/semantic-release)
- [Source repository](https://github.com/semantic-release/semantic-release)
- [HTML version](https://canirequire.com/package/semantic-release/)
- [JSON version](https://canirequire.com/package/semantic-release.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.
