Registry / babel-preset-stage-1

babel-preset-stage-1

JSON →
library6.24.1jsnpmunverified

Babel preset that includes all stage 1 ECMAScript proposal plugins. This package is deprecated and removed in Babel 7+; stage presets were removed in favor of individual proposal plugins. Version 6.24.1 is the last stable release of the legacy Babel 6 line. Use @babel/preset-env with specific proposal plugins (e.g., @babel/plugin-proposal-xxx) instead. No longer maintained.

npm install babel-preset-stage-1
INSTALL
IMPORT
SIG · BABEL-PRESET-STAGE
B
babel-preset-stage-1
javascriptv6.24.1
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
module.exports = require('babel-preset-stage-1')
import stage1 from 'babel-preset-stage-1'
Babel 6 presets are CommonJS modules. ESM import syntax is not supported directly. Use require() or configure in .babelrc.
babel-preset-stage-1 in .babelrc
{"presets": ["stage-1"]}
{"presets": ["babel-preset-stage-1"]}
Babel resolves short preset names (without 'babel-preset-') automatically. Using the full name works but is not conventional.
babel-preset-stage-1 via Node API
require('babel-core').transform(code, { presets: [require('babel-preset-stage-1')] })
require('babel-core').transform(code, { presets: ['stage-1'] })
When using Node API, you can pass either a string (resolved by Babel) or the preset object directly. Both work.

Shows how to install and configure Babel 6 stage-1 preset via .babelrc or Node API, enabling stage 1 proposals like decorators.

// Install: npm install --save-dev babel-preset-stage-1 babel-cli // .babelrc { "presets": ["stage-1"] } // Or via Node API const babel = require('babel-core'); const result = babel.transform('class A { @decorator method() {} }', { presets: ['stage-1'] }); console.log(result.code);
Debug
Known issues
deprecatedStage presets are removed in Babel 7. Use @babel/preset-env and individual @babel/plugin-proposal-* plugins.
fix
Upgrade to Babel 7 and replace 'stage-1' with specific proposal plugins like @babel/plugin-proposal-decorators, @babel/plugin-proposal-export-namespace-from, etc.
affects: >=7.0.0
breakingBabel 6 stage presets include unstable proposals that may change or be removed in future ECMAScript specs.
fix
Pin exact Babel versions and test regularly with newer presets. Consider using @babel/preset-env with targeted proposals in Babel 7.
affects: >=6.0.0
gotchaThe decorator plugin in stage-1 is the legacy (stage 1) decorator proposal, which is incompatible with the stage 2 decorators in Babel 7.
fix
If upgrading to Babel 7, use @babel/plugin-proposal-decorators with the 'legacy' option for backward compatibility.
affects: >=6.0.0
deprecatedbabel-preset-stage-1 is no longer maintained. Last version 6.24.1 dates back to 2017.
fix
Do not use for new projects. Migrate to Babel 7 or later.
affects: >=6.24.1
Errors
Common errors & fixes
Error: Plugin/Preset files are not allowed to export objects, only functions.
Using a Babel 6 preset with Babel 7 or vice versa.
fix
Ensure your Babel version matches the preset version. Use @babel/preset-env for Babel 7, or downgrade to Babel 6.
Cannot find module 'babel-preset-stage-1'
Preset not installed or not in node_modules.
fix
Run 'npm install --save-dev babel-preset-stage-1' and verify it is listed in package.json.
ReferenceError: [BABEL] unknown: Decorators transform is necessary.
Trying to use decorators without the proper plugin configuration.
fix
The stage-1 preset should include decorators. If not, add 'babel-plugin-transform-decorators-legacy' explicitly.
Upgrade
Version history
6.24.1latest on npm
Audit
Dependencies
babel-preset-stage-2requiredStage 1 preset extends stage 2 preset, which in turn extends stage 3.
babel-plugin-syntax-trailing-function-commasrequiredIncluded in stage 1 preset for trailing function comma support.
babel-plugin-transform-async-to-generatorrequiredTransforms async functions to generator functions.
babel-plugin-transform-exponentiation-operatorrequiredTransforms exponentiation operator **.
babel-plugin-transform-class-constructor-callrequiredTransforms class constructor call proposal (stage 1).
babel-plugin-transform-decoratorsrequiredTransforms decorators (legacy stage 1 proposal).
babel-plugin-transform-export-extensionsrequiredTransforms export extensions proposal.
babel-plugin-transform-object-rest-spreadrequiredTransforms object rest/spread properties.
Agent activity
4 hits · last 30 days
node
4
Resources
babel-preset-stage-1 — npm install babel-preset-stage-1 · libregistry