CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel

Deprecated meta-package that redirects users to babel-core and babel-cli for actual Babel functionality

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

index.mddocs/

Babel (Deprecated Package)

The babel package v6.23.0 is a deprecated meta-package that serves as a migration guide and prevents accidental usage of the legacy babel entry point. It provides no functional API but instead directs users to the appropriate packages for their Babel needs: babel-core for Node.js API usage and babel-cli for command-line interface.

Package Information

  • Package Name: babel
  • Package Type: npm
  • Language: JavaScript
  • Installation: npm install babel (not recommended - see migration guidance)
  • Status: Deprecated in Babel 6.x

Migration Guidance

For Node.js API Usage

Instead of: babel package Use: babel-core package

// DO NOT USE - this will throw an error
// const babel = require("babel");

// USE THIS INSTEAD
const babel = require("babel-core");

For CLI Usage

Instead of: babel package Use: babel-cli package

# Remove the deprecated package
npm uninstall babel

# Install the correct CLI package
npm install --save-dev babel-cli

Package Structure

The babel package contains only error-throwing stubs:

Node.js Entry Point

The main module entry point throws an error directing users to babel-core.

// index.js behavior - throws immediately
throw new Error("The node API for `babel` has been moved to `babel-core`.");

CLI Entry Point

The CLI script displays migration instructions and exits.

// src/cli.js behavior - prints error and exits with code 1
const globalMessage = path.dirname(process.execPath) === path.dirname(process.env._ || "") ? " -g" : "";

console.error("You have mistakenly installed the `babel` package, which is a no-op in Babel 6.\n" +
  "Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.\n" +
  "\n" +
  "    npm uninstall" + globalMessage + " babel\n" +
  "    npm install --save-dev babel-cli\n" +
  "\n" +
  "See http://babeljs.io/docs/usage/cli/ for setup instructions.");
process.exit(1);

Defined Binaries

The package.json defines CLI binaries that reference non-existent files, intentionally breaking CLI usage:

{
  "bin": {
    "babel": "./lib/cli.js",
    "babel-node": "./lib/cli.js", 
    "babel-external-helpers": "./lib/cli.js"
  }
}

Note: The ./lib/cli.js file does not exist, which prevents these binaries from functioning.

Error Messages

Node API Error

When requiring the babel package in Node.js:

Error: The node API for `babel` has been moved to `babel-core`.

CLI Error

When attempting to use babel CLI commands:

You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.

    npm uninstall babel
    npm install --save-dev babel-cli

See http://babeljs.io/docs/usage/cli/ for setup instructions.

Recommended Alternatives

For actual Babel functionality, use these packages instead:

  • babel-core: Core Babel transformation API for Node.js applications
  • babel-cli: Command-line interface for Babel transformations
  • babel-preset-env: Smart preset for modern JavaScript features
  • babel-loader: Webpack loader for Babel transformations

Historical Context

This package exists because in Babel 6.x, the architecture was restructured to separate concerns:

  • The monolithic babel package was split into focused packages
  • babel-core provides the transformation engine
  • babel-cli provides command-line tools
  • Individual plugins and presets are separate packages

The stub babel package prevents breaking existing installations while guiding users to the correct packages.

docs

index.md

tile.json