canirequire › ESM-only › @oclif/plugin-help
Is @oclif/plugin-help ESM-only? Can you require() it?
Standard help for oclif.
Last verified Sep 9, 2026 against @oclif/plugin-help@7.0.0. Markdown · JSON
ESM-only ESM-only since 6.0.1 — last CommonJS version is 5.2.20
@oclif/plugin-help dropped its CommonJS build in 6.0.1 (October 2023). The last version with a plain require()-able CommonJS entry is 5.2.20, published Sep 28, 2023; it declares support for Node.js >=12.0.0.
On Node.js 22.12+ and newer (@oclif/plugin-help@7.0.0 declares Node.js >=22.0.0), require("@oclif/plugin-help") 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 @oclif/plugin-help@7.0.0 declares Node.js >=22.0.0, so 18 is outside its supported range anyway.
@oclif/plugin-help@7.0.0 declares engines ">=22.0.0", so Node.js 18, 20 are outside its supported range regardless of module format.
What to do
- On Node.js 22.12+ and newer (@oclif/plugin-help@7.0.0 declares Node.js >=22.0.0), require("@oclif/plugin-help") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26.
- From a CommonJS file, use a dynamic import inside an async function: const pluginHelp = await import("@oclif/plugin-help"). That works on every Node.js version the package supports (>=22.0.0).
- If you need a synchronous require() or run Node.js 18: npm install @oclif/plugin-help@5.2.20, the last CommonJS release (published Sep 28, 2023); it declares Node.js >=12.0.0.
- @oclif/plugin-help@7.0.0 declares engines ">=22.0.0", so Node.js 18, 20 are unsupported regardless: upgrade Node.js or pin an older release.
- TypeScript: types are bundled; install nothing extra.
Does @oclif/plugin-help@7.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@oclif/plugin-help") from a CommonJS file and import "@oclif/plugin-help" from an ES module.
| Runtime | require("@oclif/plugin-help") | import "@oclif/plugin-help" |
|---|---|---|
| Node.js 18 | ✗ failsERR_REQUIRE_ESM | ✓ works |
| 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 @oclif/plugin-help
ES modules (import)
import * as pluginHelp from "@oclif/plugin-help";Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.
CommonJS (require)
// Node.js 22.12+ and newer (verified):
const pluginHelp = require("@oclif/plugin-help");
// Any Node.js version the package supports (>=22.0.0), from an async function:
async function main() {
const pluginHelp = await import("@oclif/plugin-help");
}
// Or pin the last CommonJS release (declares Node.js >=12.0.0):
// npm install @oclif/plugin-help@5.2.20Module 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 (207 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 6.2.1 – 7.0.0 | ESM-only | Jun 9, 2024 |
Frequently asked
Is @oclif/plugin-help ESM-only?
@oclif/plugin-help@7.0.0 is ESM-only. @oclif/plugin-help dropped its CommonJS build in 6.0.1 (October 2023). The last version with a plain require()-able CommonJS entry is 5.2.20, published Sep 28, 2023; it declares support for Node.js >=12.0.0.
Which version of @oclif/plugin-help still supports CommonJS / require()?
5.2.20 is the last version of @oclif/plugin-help with a CommonJS build; it declares Node.js >=12.0.0. Install it with "npm install @oclif/plugin-help@5.2.20". Every version from 6.0.1 on is ESM-only.
How do I use @oclif/plugin-help from a CommonJS file?
From a CommonJS file, use a dynamic import inside an async function: const pluginHelp = await import("@oclif/plugin-help"). That works on every Node.js version the package supports (>=22.0.0). On Node.js 22.12+ and newer (@oclif/plugin-help@7.0.0 declares Node.js >=22.0.0), require("@oclif/plugin-help") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26. Alternatively pin @oclif/plugin-help@5.2.20 (declares Node.js >=12.0.0).
Does @oclif/plugin-help work in Bun?
Yes. import "@oclif/plugin-help" loaded successfully in Bun 1.4.0 on Sep 9, 2026.
Does @oclif/plugin-help ship TypeScript types?
Yes. @oclif/plugin-help 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
- bcrypt 6.0.0CommonJS
- postcss-scss 4.0.9Dual
- @babel/preset-flow 8.0.1ESM-only
- @angular/core 22.1.5ESM-only
- babel-plugin-dynamic-import-node 2.3.3CommonJS
- file-saver 2.0.5CommonJS
- log4js 6.9.1CommonJS
- eslint-plugin-simple-import-sort 14.0.0CommonJS