Registry / babel-core

babel-core

JSON →
library6.26.3jsnpmunverified

Babel compiler core version 6.26.3. This is an outdated version of Babel (pre-7.x). The current stable releases are v7.29.2 (2026-03-16) and v8.0.0-rc.3 (2026-03-16). babel-core v6 is no longer maintained and should not be used for new projects. Key differentiator vs v7/v8: v6 uses the `babel-core` package while v7+ uses `@babel/core`. It provides core transformation API including `transform`, `transformFile`, `transformFileSync`, and `transformFromAst` methods. Compatible with Node.js and browsers via bundlers. Does not include presets/plugins; those are separate packages.

npm install babel-core
INSTALL
IMPORT
SIG · BABEL-CORE
B
babel-core
javascriptv6.26.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import babel from 'babel-core'
const babel = require('babel-core')
Default import provides the main API object. CommonJS require works but ESM is preferred for bundlers.
transform
import { transform } from 'babel-core'
import transform from 'babel-core'
transform is a named export. Named export is available since v6.
transformFile
import { transformFile } from 'babel-core'
Asynchronous transform of a file. Named export.
transformFileSync
import { transformFileSync } from 'babel-core'
Synchronous version of transformFile.
transformFromAst
import { transformFromAst } from 'babel-core'
Transform from an AST object.

Transforms ES6 arrow function to ES5 using babel-core transform API with env preset.

import { transform } from 'babel-core'; const code = 'const x = (a, b) => a + b;'; const result = transform(code, { presets: ['env'] // requires @babel/preset-env or babel-preset-env }); console.log(result.code); // Output: "var x = function x(a, b) { return a + b; };"
babel --version
Debug
Known issues
deprecatedbabel-core v6 is deprecated. Use @babel/core v7+ instead.
fix
Install @babel/core: npm install --save-dev @babel/core and update imports to use '@babel/core'.
affects: >=6.0.0 <7.0.0
gotchababel-core v6 does not include any presets. You must install presets separately (e.g., babel-preset-env) to transpile ES6+ code.
fix
Install presets: npm install --save-dev babel-preset-env and add 'presets: ["env"]' to options.
affects: >=6.0.0 <7.0.0
gotchaUser-local configuration files (.babelrc) are automatically loaded if babelrc option is not set to false. This may cause unexpected behavior.
fix
Set options.babelrc = false to ignore .babelrc files.
affects: >=6.0.0 <7.0.0
breakingIn babel-core v6, default options differ from v7 (e.g., 'ast' defaults to true). Be aware when migrating.
fix
Review Babel v7 migration guide for option changes.
affects: >=6.0.0 <7.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-core'
babel-core not installed or moved to @babel/core in v7.
fix
Install babel-core v6: npm install --save-dev babel-core@6.26.3 or migrate to v7: npm install --save-dev @babel/core.
TypeError: babel.transform is not a function
Using default import incorrectly; transform is a named export.
fix
Use import { transform } from 'babel-core' or const transform = require('babel-core').transform.
Error: Requires Babel "7.0.0-0" but was loaded with "6.26.3"
Mixing babel-core v6 with plugins/presets designed for v7.
fix
Ensure all babel packages are of the same major version. For v6, use packages like babel-preset-env; for v7, use @babel/preset-env.
Upgrade
Version history
6.26.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
Resources