# Is yeoman-test ESM-only? Can you require() it?

> yeoman-test@11.8.2 is ESM-only. ESM-only since 7.0.0 — last CommonJS version is 6.3.0.

Test utilities for Yeoman generators

Last verified Sep 9, 2026 against yeoman-test@11.8.2.

yeoman-test dropped its CommonJS build in 7.0.0 (November 2022). The last version with a plain require()-able CommonJS entry is 6.3.0, published Feb 1, 2022; it declares support for Node.js >=12.10.0.

require("yeoman-test") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. Node.js 18 has no require(esm), and yeoman-test@11.8.2 declares Node.js ^20.6.1 || >=22, so 18 is outside its supported range anyway.

yeoman-test@11.8.2 declares engines "^20.6.1 || >=22", so Node.js 18 is outside its supported range regardless of module format.

## What to do

1. require("yeoman-test") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.
2. From a CommonJS file, use a dynamic import inside an async function: const yeomanTest = await import("yeoman-test"). That works on every Node.js version the package supports (^20.6.1 || >=22).
3. If you need a synchronous require() or run Node.js 18: npm install yeoman-test@6.3.0, the last CommonJS release (published Feb 1, 2022); it declares Node.js >=12.10.0.
4. yeoman-test@11.8.2 declares engines "^20.6.1 || >=22", so Node.js 18 is unsupported regardless: upgrade Node.js or pin an older release.
5. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 11.8.2 (Sep 7, 2026)
- Module format: ESM-only
- Last CommonJS version: 6.3.0
- ESM-only since: 7.0.0 (Nov 29, 2022)
- TypeScript types: bundled
- Node engines: ^20.6.1 || >=22
- Weekly downloads: 141K
- License: MIT

## Runtime test results for yeoman-test@11.8.2

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

| Runtime | require("yeoman-test") | import "yeoman-test" |
|---|---|---|
| Node.js 18 | fails (ERR_REQUIRE_ESM) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 20 | fails (ERR_MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 22 | fails (ERR_MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 24 | fails (ERR_MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Node.js 26 | fails (ERR_MODULE_NOT_FOUND) | fails (ERR_MODULE_NOT_FOUND) |
| Bun 1.4.0 | fails (Error) | fails (Error) |

## How to import yeoman-test

ES modules:

```js
import * as yeomanTest from "yeoman-test";
```

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

CommonJS:

```js
// require("yeoman-test") failed in our probe on Node.js 20.19+, 22.12+ and newer as well (ERR_MODULE_NOT_FOUND); see the runtime table.

// Any Node.js version the package supports (^20.6.1 || >=22), from an async function:
async function main() {
  const yeomanTest = await import("yeoman-test");
}

// Or pin the last CommonJS release (declares Node.js >=12.10.0):
// npm install yeoman-test@6.3.0
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 7.0.0 – 11.8.2 | ESM-only | Nov 29, 2022 |
| 1.7.1 – 6.3.0 | CommonJS | May 9, 2018 |

## Frequently asked

**Is yeoman-test ESM-only?**

yeoman-test@11.8.2 is ESM-only. yeoman-test dropped its CommonJS build in 7.0.0 (November 2022). The last version with a plain require()-able CommonJS entry is 6.3.0, published Feb 1, 2022; it declares support for Node.js >=12.10.0.

**Which version of yeoman-test still supports CommonJS / require()?**

6.3.0 is the last version of yeoman-test with a CommonJS build; it declares Node.js >=12.10.0. Install it with "npm install yeoman-test@6.3.0". Every version from 7.0.0 on is ESM-only.

**How do I use yeoman-test from a CommonJS file?**

From a CommonJS file, use a dynamic import inside an async function: const yeomanTest = await import("yeoman-test"). That works on every Node.js version the package supports (^20.6.1 || >=22). require("yeoman-test") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. Alternatively pin yeoman-test@6.3.0 (declares Node.js >=12.10.0).

**Does yeoman-test work in Bun?**

Importing yeoman-test failed in Bun 1.4.0 on Sep 9, 2026: error: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js'

**Does yeoman-test ship TypeScript types?**

Yes. yeoman-test bundles its own type declarations; no @types package is needed.

## Links

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