{"id":19338,"library":"babel-preset-stage-1","title":"babel-preset-stage-1","description":"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.","status":"deprecated","version":"6.24.1","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel/tree/master/packages/babel-preset-stage-1","tags":["javascript"],"install":[{"cmd":"npm install babel-preset-stage-1","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-stage-1","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-stage-1","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Stage 1 preset extends stage 2 preset, which in turn extends stage 3.","package":"babel-preset-stage-2","optional":false},{"reason":"Included in stage 1 preset for trailing function comma support.","package":"babel-plugin-syntax-trailing-function-commas","optional":false},{"reason":"Transforms async functions to generator functions.","package":"babel-plugin-transform-async-to-generator","optional":false},{"reason":"Transforms exponentiation operator **.","package":"babel-plugin-transform-exponentiation-operator","optional":false},{"reason":"Transforms class constructor call proposal (stage 1).","package":"babel-plugin-transform-class-constructor-call","optional":false},{"reason":"Transforms decorators (legacy stage 1 proposal).","package":"babel-plugin-transform-decorators","optional":false},{"reason":"Transforms export extensions proposal.","package":"babel-plugin-transform-export-extensions","optional":false},{"reason":"Transforms object rest/spread properties.","package":"babel-plugin-transform-object-rest-spread","optional":false}],"imports":[{"note":"Babel 6 presets are CommonJS modules. ESM import syntax is not supported directly. Use require() or configure in .babelrc.","wrong":"import stage1 from 'babel-preset-stage-1'","symbol":"default","correct":"module.exports = require('babel-preset-stage-1')"},{"note":"Babel resolves short preset names (without 'babel-preset-') automatically. Using the full name works but is not conventional.","wrong":"{\"presets\": [\"babel-preset-stage-1\"]}","symbol":"babel-preset-stage-1 in .babelrc","correct":"{\"presets\": [\"stage-1\"]}"},{"note":"When using Node API, you can pass either a string (resolved by Babel) or the preset object directly. Both work.","wrong":"require('babel-core').transform(code, { presets: ['stage-1'] })","symbol":"babel-preset-stage-1 via Node API","correct":"require('babel-core').transform(code, { presets: [require('babel-preset-stage-1')] })"}],"quickstart":{"code":"// Install: npm install --save-dev babel-preset-stage-1 babel-cli\n// .babelrc\n{\n  \"presets\": [\"stage-1\"]\n}\n\n// Or via Node API\nconst babel = require('babel-core');\nconst result = babel.transform('class A { @decorator method() {} }', {\n  presets: ['stage-1']\n});\nconsole.log(result.code);","lang":"javascript","description":"Shows how to install and configure Babel 6 stage-1 preset via .babelrc or Node API, enabling stage 1 proposals like decorators."},"warnings":[{"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.","message":"Stage presets are removed in Babel 7. Use @babel/preset-env and individual @babel/plugin-proposal-* plugins.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Pin exact Babel versions and test regularly with newer presets. Consider using @babel/preset-env with targeted proposals in Babel 7.","message":"Babel 6 stage presets include unstable proposals that may change or be removed in future ECMAScript specs.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"If upgrading to Babel 7, use @babel/plugin-proposal-decorators with the 'legacy' option for backward compatibility.","message":"The decorator plugin in stage-1 is the legacy (stage 1) decorator proposal, which is incompatible with the stage 2 decorators in Babel 7.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Do not use for new projects. Migrate to Babel 7 or later.","message":"babel-preset-stage-1 is no longer maintained. Last version 6.24.1 dates back to 2017.","severity":"deprecated","affected_versions":">=6.24.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure your Babel version matches the preset version. Use @babel/preset-env for Babel 7, or downgrade to Babel 6.","cause":"Using a Babel 6 preset with Babel 7 or vice versa.","error":"Error: Plugin/Preset files are not allowed to export objects, only functions."},{"fix":"Run 'npm install --save-dev babel-preset-stage-1' and verify it is listed in package.json.","cause":"Preset not installed or not in node_modules.","error":"Cannot find module 'babel-preset-stage-1'"},{"fix":"The stage-1 preset should include decorators. If not, add 'babel-plugin-transform-decorators-legacy' explicitly.","cause":"Trying to use decorators without the proper plugin configuration.","error":"ReferenceError: [BABEL] unknown: Decorators transform is necessary."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}