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
- require("yeoman-test") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.
- 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).
- 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.
- 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.
- TypeScript: types are bundled; install nothing extra.
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.
| Runtime | require("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.0Module 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).
| 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
Other esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1 - escape-string-regexp 5.0.0last CJS
4.0.0
Similar popularity
- grunt-contrib-connect 5.0.1CommonJS
- vinyl-buffer 1.0.1CommonJS
- rollup-plugin-node-builtins 2.1.2CommonJS
- rollup-plugin-replace 2.2.0CommonJS
- xo 4.0.0ESM-only
- gulp-watch 5.0.1CommonJS
- np 12.1.0No entry
- ember-data 5.9.1ESM-only