Registry / devops / babel-register-cli

babel-register-cli

JSON →
library5.0.0jsnpmunverified

A CLI tool that wraps babel-register to enable running ES6+ scripts directly with Node. Version 5.0.0 is the latest stable, with low release cadence. Unlike babel-node which is discouraged in production, this tool uses babel-register to avoid that issue. It provides a simple command-line interface identical to node, but with automatic babel transpilation. Different from alternatives like ts-node for TypeScript or directly using babel-register, this tool offers a cleaner command-line experience without manual require('babel-register') calls.

npm install babel-register-cli
INSTALL
IMPORT
SIG · BABEL-REGISTER-CLI
B
babel-register-cli
devopsjavascriptv5.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

babel-register-cli
npm install -g babel-register-cli
npm install babel-register-cli --save
Typically installed globally for CLI use; avoid local installs.
cli usage
babel-register my-es6.js
node -r babel-register my-es6.js
Use the CLI directly instead of manual require hook.
programmatic usage
require('babel-register'); require('./my-es6.js');
require('babel-register-cli');
The package is CLI-only; for programmatic use, use babel-register directly.

Install babel-register-cli globally, create an ES6 arrow function script, and run it with the CLI.

npm install -g babel-register-cli # Create an ES6 file cat > app.js << 'EOF' const greet = (name) => console.log(`Hello, ${name}!`); greet('World'); EOF # Run with babel-register-cli babel-register app.js
Debug
Known issues
gotchaRequires babel-register as a peer dependency and babel-core to be installed.
fix
Ensure babel-register and a compatible babel-core version are installed globally or locally.
affects: >=1.0.0
deprecatedbabel-register is deprecated in favor of @babel/register (Babel 7).
fix
Migrate to @babel/register and consider using @babel/node instead.
affects: >=5.0.0
gotchaCLI arguments are passed to Node, not to babel, causing confusion when trying to pass babel options.
fix
Use .babelrc or babel configuration files instead of CLI flags.
affects: >=1.0.0
breakingVersion 5.0.0 may have changed peer dependency requirements; Babel 7 compatibility uncertain.
fix
Check Babel version compatibility; consider using @babel/register directly.
affects: 5.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-register'
babel-register is not installed or not in the module path.
fix
npm install babel-register (or globally with -g)
bash: babel-register: command not found
Global install not in PATH or not performed.
fix
npm install -g babel-register-cli and verify PATH.
Error: require() of ES modules is not supported
babel-register cannot handle native ES modules.
fix
Use commonjs module format or upgrade to Babel 7 with @babel/register.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
babel-registerrequiredrequired for babel transpilation
Agent activity
7 hits · last 30 days
node
6
Resources
babel-register-cli — npm install babel-register-cli · libregistry