{"id":19319,"library":"babel-preset-node8","title":"babel-preset-node8","description":"Babel 6 preset for Node.js 7.10–8.x. This preset enables ES2015+ features that are not natively supported in Node 7.10+, including class properties, object rest/spread, export extensions, async generators, and trailing function commas. It also includes production-specific minification and dead code elimination plugins. Version 1.2.0 is the latest stable release. This package is specifically tailored for Node 7.10 to 8.x and is not intended for use with other Node versions or Babel 7.","status":"maintenance","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/lestad/babel-preset-node8","tags":["javascript","babel","babel-preset","babel-preset-node8","babel-preset-node6","babel-preset-node7","node","node6","node7"],"install":[{"cmd":"npm install babel-preset-node8","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-node8","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-node8","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Alternative preset that covers similar use cases with broader Node version support","package":"babel-preset-env","optional":false},{"reason":"Similar functionality for Stage 3 proposals; often confused with this preset","package":"babel-preset-stage-3","optional":true}],"imports":[{"note":"The preset is typically used via .babelrc as a string 'node8', not directly imported in code. However, if importing via Node API, use default import.","wrong":"const babelPresetNode8 = require('babel-preset-node8')","symbol":"default (preset)","correct":"import babelPresetNode8 from 'babel-preset-node8'"},{"note":"The createPreset helper is a separate internal module; not exported from the main package.","wrong":"import { createPreset } from 'babel-preset-node8'","symbol":"createPreset","correct":"import createPreset from 'babel-preset-node8/lib/create-preset'"},{"note":"The 'env' preset variant is an internal module; do not import it directly.","wrong":"import { env } from 'babel-preset-node8'","symbol":"env","correct":"import envPreset from 'babel-preset-node8/lib/env'"}],"quickstart":{"code":"npm install --save-dev babel-preset-node8\n\n# .babelrc\n{\n  \"presets\": [\"node8\"]\n}\n\n# Use with babel-cli\n# babel src --out-dir dist --presets node8","lang":"javascript","description":"Show how to install and configure the babel-preset-node8 preset for Babel 6."},"warnings":[{"fix":"Use @babel/preset-env with targets for Node 8 instead.","message":"Babel 6 is deprecated; Babel 7 is now standard. This preset does not support Babel 7.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use babel-preset-node6 for Node 6, or babel-preset-env for broader Node support.","message":"This preset is specifically for Node 7.10–8.x. Using it with Node 6 or Node 9+ may cause compatibility issues.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Set NODE_ENV=production explicitly to enable production optimizations.","message":"The production plugins (block-scoping, for-of, minify) are automatically applied based on NODE_ENV. If NODE_ENV is not set, production plugins are not used.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If targeting Node <8, do not rely on this plugin for runtime support.","message":"syntax-trailing-function-commas is a syntax plugin only; it does not transform code. Ensure that your target Node version supports trailing commas in function calls (Node 8).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Migrate to Babel 7 and use @babel/preset-env instead.","cause":"Using this preset with Babel 7 or newer, which expects presets to export functions instead of objects.","error":"Error: Plugin/Preset files are not allowed to export objects, only functions. In /path/to/node_modules/babel-preset-node8/index.js"},{"fix":"Ensure Node version is >=7.10, or add @babel/plugin-transform-runtime and @babel/runtime.","cause":"The preset does not include async-to-generator or regenerator runtime; async/await must be natively supported by Node 7.10+.","error":"ReferenceError: regeneratorRuntime is not defined"},{"fix":"Run 'npm install --save-dev babel-preset-node8' and ensure package.json includes it.","cause":"The preset is not installed or the package name is misspelled.","error":"Module not found: Can't resolve 'babel-preset-node8' in /path/to/project"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}