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

> @semantic-release/github@12.0.9 is ESM-only. ESM-only since 9.0.0 — last CommonJS version is 8.1.0.

semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues

Last verified Sep 9, 2026 against @semantic-release/github@12.0.9.

@semantic-release/github dropped its CommonJS build in 9.0.0 (June 2023). The last version with a plain require()-able CommonJS entry is 8.1.0, published May 28, 2023; it declares support for Node.js >=14.17.

On Node.js 22.12+ and newer (@semantic-release/github@12.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("@semantic-release/github") 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/github@12.0.9 declares Node.js ^22.14.0 || >= 24.10.0, so 18 is outside its supported range anyway.

@semantic-release/github@12.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/github@12.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("@semantic-release/github") 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 github = await import("@semantic-release/github"). 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/github@8.1.0, the last CommonJS release (published May 28, 2023); it declares Node.js >=14.17.
4. @semantic-release/github@12.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: no types are available for @semantic-release/github; declare the module yourself if you need them.

## Facts

- Latest: 12.0.9 (Jul 1, 2026)
- Module format: ESM-only
- Last CommonJS version: 8.1.0
- ESM-only since: 9.0.0 (Jun 2, 2023)
- TypeScript types: none
- Node engines: ^22.14.0 || >= 24.10.0
- Weekly downloads: 2.8M
- License: MIT

## Runtime test results for @semantic-release/github@12.0.9

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

| Runtime | require("@semantic-release/github") | import "@semantic-release/github" |
|---|---|---|
| Node.js 18 | fails (ERR_REQUIRE_ESM) | fails (ReferenceError) |
| 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/github

ES modules:

```js
import * as github from "@semantic-release/github";
```

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 github = require("@semantic-release/github");

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

// Or pin the last CommonJS release (declares Node.js >=14.17):
// npm install @semantic-release/github@8.1.0
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 9.0.0 – 12.0.9 | ESM-only | Jun 2, 2023 |
| 8.0.7 – 8.1.0 | CommonJS | Nov 28, 2022 |

## Frequently asked

**Is @semantic-release/github ESM-only?**

@semantic-release/github@12.0.9 is ESM-only. @semantic-release/github dropped its CommonJS build in 9.0.0 (June 2023). The last version with a plain require()-able CommonJS entry is 8.1.0, published May 28, 2023; it declares support for Node.js >=14.17.

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

8.1.0 is the last version of @semantic-release/github with a CommonJS build; it declares Node.js >=14.17. Install it with "npm install @semantic-release/github@8.1.0". Every version from 9.0.0 on is ESM-only.

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

From a CommonJS file, use a dynamic import inside an async function: const github = await import("@semantic-release/github"). 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/github@12.0.9 declares Node.js ^22.14.0 || >= 24.10.0), require("@semantic-release/github") 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/github@8.1.0 (declares Node.js >=14.17).

**Does @semantic-release/github work in Bun?**

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

**Does @semantic-release/github ship TypeScript types?**

No. @semantic-release/github ships no type declarations and there is no @types package for it.

## Links

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