Registry / devops / babel-cli

babel-cli

JSON →
library0.3.5jsnpmunverified

Babel command line interface for transpiling JavaScript files using Babel 6. Latest stable version is 6.26.0 (no longer actively developed). This package is part of the legacy Babel 6 ecosystem and has been superseded by @babel/cli in Babel 7+. Key differentiators: provides CLI tools like babel, babel-node, and babel-external-helpers. No further releases expected; users should migrate to @babel/cli for Babel 7+.

npm install babel-cli
INSTALL
IMPORT
SIG · BABEL-CLI
B
babel-cli
devopsjavascriptv0.3.5
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.

CLI command
npx babel script.js
babel script.js (requires global install)
Use npx or install locally; global install is discouraged.
babel-node
npx babel-node script.js
node script.js (without transpilation)
babel-node is a CLI tool, not a library import.
babel-external-helpers
npx babel-external-helpers
Generates a file with helper functions for external use.

Shows typical usage: install, configure preset, transpile files, use watch mode, and run scripts with babel-node.

// Install babel-cli and a preset npm install --save-dev babel-cli babel-preset-env // Create .babelrc { "presets": ["env"] } // Transpile a file npx babel input.js --out-file output.js // Watch mode npx babel input.js --watch --out-file output.js // Run with babel-node (ES6 support) npx babel-node -e "console.log([1,2,3].map(x => x*2))"
babel --version
Debug
Known issues
deprecatedbabel-cli is deprecated in favor of @babel/cli. No new features or bug fixes.
fix
Migrate to @babel/cli and @babel/core (Babel 7+): npm install --save-dev @babel/cli @babel/core @babel/preset-env
affects: >=6.0.0
breakingBabel 6 to 7 breaks compatibility: presets/plugins renamed, AST changes, CLI options changed.
fix
Use @babel/preset-env instead of babel-preset-env, @babel/plugin-* instead of babel-plugin-*. Check Babel 7 migration guide.
affects: >=6.0.0
gotchaRequires babel-core to be installed separately (not a dependency of babel-cli).
fix
Install both: npm install --save-dev babel-cli babel-core
affects: >=6.0.0
gotchababel-node is not suitable for production use due to memory leaks and startup delay.
fix
Pre-compile code for production, or use ts-node-like alternatives.
affects: >=6.0.0
deprecatedbabel-preset-env replaces babel-preset-es2015, es2016, etc. in Babel 6+.
fix
Use babel-preset-env and configure targets.
affects: >=6.15.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-core'
babel-cli depends on babel-core as a peer dependency but does not install it automatically.
fix
Run: npm install --save-dev babel-cli babel-core
ReferenceError: regeneratorRuntime is not defined
Using async/await without Babel's runtime polyfill.
fix
Add babel-plugin-transform-runtime or include babel-polyfill: npm install --save-dev babel-plugin-transform-runtime and add plugin to .babelrc
Error: Requires Babel "7", but was loaded with "6.x"
Mixing Babel 6 CLI with Babel 7 core packages accidentally.
fix
Uninstall babel-cli and install @babel/cli @babel/core: npm uninstall babel-cli && npm install --save-dev @babel/cli @babel/core
babel: command not found
babel-cli is not installed globally or local node_modules/.bin is not in PATH.
fix
Use npx babel or add node_modules/.bin to PATH, or install globally: npm install -g babel-cli
Upgrade
Version history
0.3.5latest on npm
Audit
Dependencies
babel-corerequiredCore Babel compiler required for transpilation
chokidaroptionalFile watching for --watch flag
Agent activity
2 hits · last 30 days
node
2
Resources
babel-cli — npm install babel-cli · libregistry