canirequire › Dual (CommonJS + ESM) › @babel/runtime
Is @babel/runtime ESM-only? Can you require() it?
babel's modular runtime helpers
Last verified Sep 9, 2026 against @babel/runtime@8.0.0. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@babel/runtime publishes both a CommonJS entry and a native ESM entry (ESM added in 7.13.8). require("@babel/runtime") and import "@babel/runtime" both work on every supported Node.js version and in Bun.
Does @babel/runtime@8.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@babel/runtime") from a CommonJS file and import "@babel/runtime" from an ES module.
| Runtime | require("@babel/runtime") | import "@babel/runtime" |
|---|---|---|
| Node.js 18 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED |
| Node.js 20 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED |
| Node.js 22 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED |
| Node.js 24 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED |
| Node.js 26 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED |
| Bun 1.4 | ✗ failserror: Cannot find module '@babel/runtime' from '/Users/boat/Projects/top-seo/data/probe-work/@babel__runtime/req.cjs' | ✗ failserror: Cannot find module '@babel/runtime' from '/Users/boat/Projects/top-seo/data/probe-work/@babel__runtime/imp.mjs' |
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 @babel/runtime
ES modules (import)
import runtime from "@babel/runtime";CommonJS (require)
const runtime = require("@babel/runtime");Module format by version
Derived from the type, main and exports fields of every stable release on npm (136 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 7.17.9 – 8.0.0 | Dual (CommonJS + ESM) | Apr 6, 2022 |
Frequently asked
Is @babel/runtime ESM-only?
@babel/runtime@8.0.0 ships CommonJS and ESM builds. @babel/runtime publishes both a CommonJS entry and a native ESM entry (ESM added in 7.13.8). require("@babel/runtime") and import "@babel/runtime" both work on every supported Node.js version and in Bun.
Can I require @babel/runtime?
Yes. @babel/runtime ships a CommonJS entry, so require("@babel/runtime") works on every Node.js version, alongside the native ESM entry for import.
Does @babel/runtime work in Bun?
Importing @babel/runtime failed in Bun 1.4 on Sep 9, 2026: error: Cannot find module '@babel/runtime' from '/Users/boat/Projects/top-seo/data/probe-work/@babel__runtime/imp.mjs'
Does @babel/runtime ship TypeScript types?
No. @babel/runtime ships no type declarations and there is no @types package for it.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- anakjalanan 1.1.4CommonJS
- @babel/types 8.0.4ESM-only
- @babel/parser 8.0.4ESM-only
- @babel/helper-validator-identifier 8.0.4ESM-only
- @radix-ui/react-primitive 2.1.10Dual
- @jridgewell/trace-mapping 0.3.31Dual
- @jridgewell/resolve-uri 3.1.2Dual
- @babel/generator 8.0.0ESM-only