Registry / devops / babel-preset-node8

babel-preset-node8

JSON →
library1.2.0jsnpmunverified

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.

npm install babel-preset-node8
INSTALL
IMPORT
SIG · BABEL-PRESET-NODE8
B
babel-preset-node8
devopsjavascriptv1.2.0
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 (preset)
import babelPresetNode8 from 'babel-preset-node8'
const babelPresetNode8 = require('babel-preset-node8')
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.
createPreset
import createPreset from 'babel-preset-node8/lib/create-preset'
import { createPreset } from 'babel-preset-node8'
The createPreset helper is a separate internal module; not exported from the main package.
env
import envPreset from 'babel-preset-node8/lib/env'
import { env } from 'babel-preset-node8'
The 'env' preset variant is an internal module; do not import it directly.

Show how to install and configure the babel-preset-node8 preset for Babel 6.

npm install --save-dev babel-preset-node8 # .babelrc { "presets": ["node8"] } # Use with babel-cli # babel src --out-dir dist --presets node8
Debug
Known issues
deprecatedBabel 6 is deprecated; Babel 7 is now standard. This preset does not support Babel 7.
fix
Use @babel/preset-env with targets for Node 8 instead.
affects: >=1.0.0
breakingThis preset is specifically for Node 7.10–8.x. Using it with Node 6 or Node 9+ may cause compatibility issues.
fix
Use babel-preset-node6 for Node 6, or babel-preset-env for broader Node support.
affects: >=1.0.0
gotchaThe 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.
fix
Set NODE_ENV=production explicitly to enable production optimizations.
affects: >=1.0.0
gotchasyntax-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).
fix
If targeting Node <8, do not rely on this plugin for runtime support.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Plugin/Preset files are not allowed to export objects, only functions. In /path/to/node_modules/babel-preset-node8/index.js
Using this preset with Babel 7 or newer, which expects presets to export functions instead of objects.
fix
Migrate to Babel 7 and use @babel/preset-env instead.
ReferenceError: regeneratorRuntime is not defined
The preset does not include async-to-generator or regenerator runtime; async/await must be natively supported by Node 7.10+.
fix
Ensure Node version is >=7.10, or add @babel/plugin-transform-runtime and @babel/runtime.
Module not found: Can't resolve 'babel-preset-node8' in /path/to/project
The preset is not installed or the package name is misspelled.
fix
Run 'npm install --save-dev babel-preset-node8' and ensure package.json includes it.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
babel-preset-envrequiredAlternative preset that covers similar use cases with broader Node version support
babel-preset-stage-3optionalSimilar functionality for Stage 3 proposals; often confused with this preset
Agent activity
2 hits · last 30 days
node
2
Resources
babel-preset-node8 — npm install babel-preset-node8 · libregistry