canirequire

canirequire › ESM-only › yeoman-test

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

Test utilities for Yeoman generators

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

ESM-only ESM-only since 7.0.0 — last CommonJS version is 6.3.0

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

Does yeoman-test@11.8.2 actually load? Runtime test results

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

Runtimerequire("yeoman-test")import "yeoman-test"
Node.js 18✗ failsERR_REQUIRE_ESM✗ failsERR_MODULE_NOT_FOUND
Node.js 20✗ failsERR_MODULE_NOT_FOUND✗ failsERR_MODULE_NOT_FOUND
Node.js 22✗ failsERR_MODULE_NOT_FOUND✗ failsERR_MODULE_NOT_FOUND
Node.js 24✗ failsERR_MODULE_NOT_FOUND✗ failsERR_MODULE_NOT_FOUND
Node.js 26✗ failsERR_MODULE_NOT_FOUND✗ failsERR_MODULE_NOT_FOUND
Bun 1.4.0✗ failsError✗ failsError

How to import yeoman-test

ES modules (import)

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 (require)

// 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, corrected where a runtime test of that version contradicted them (68 versions; the newest 60 shown).

VersionsFormatFirst published
7.0.0 – 11.8.2ESM-onlyNov 29, 2022
1.7.1 – 6.3.0CommonJSMay 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

Other esm-only packages

Similar popularity