canirequire

canirequireDual (CommonJS + ESM) › 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. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

yeoman-test publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("yeoman-test") and import "yeoman-test" both work on every supported Node.js version and in Bun.

Latest
11.8.2 (Sep 7, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
11.8.2
Native ESM since
7.0.0
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✗ failserror: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js'✗ failserror: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js'

A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.

How to import yeoman-test

ES modules (import)

import yeomanTest from "yeoman-test";

CommonJS (require)

const yeomanTest = require("yeoman-test");

Module format by version

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

VersionsFormatFirst published
10.1.0 – 11.8.2Dual (CommonJS + ESM)Mar 21, 2025
7.0.0 – 10.0.1ESM-onlyNov 29, 2022
1.7.1 – 6.3.0CommonJSMay 9, 2018

Frequently asked

Is yeoman-test ESM-only?

yeoman-test@11.8.2 ships CommonJS and ESM builds. yeoman-test publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("yeoman-test") and import "yeoman-test" both work on every supported Node.js version and in Bun.

Can I require yeoman-test?

Yes. yeoman-test ships a CommonJS entry, so require("yeoman-test") works on every Node.js version, alongside the native ESM entry for import.

Does yeoman-test work in Bun?

Importing yeoman-test failed in Bun 1.4 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 dual (commonjs + esm) packages

Similar popularity