babel-preset-node6
raw JSON → 11.0.0 verified Sat Apr 25 auth: no javascript deprecated
v11.0.0 — Babel preset that transpiles only the ES2015 features missing in Node 6.x (V8 v5.x, ~93% coverage). Unlike the full ES2015 preset, this complements native V8 support, resulting in faster builds and execution. The preset includes only two plugins: trailing function commas and CommonJS modules. Last updated in 2017; no newer releases for current Node versions.
Common errors
error Error: Couldn't find preset "babel-preset-node6" relative to directory ↓
cause Preset not installed or incorrect name used in configuration.
fix
Run npm install babel-preset-node6 and use short name "node6" in presets array.
error SyntaxError: Unexpected token import ↓
cause Babel not configured to transpile ES modules.
fix
Ensure .babelrc includes "presets": ["node6"] and that babel-register or babel-cli is used.
Warnings
deprecated Node 6.x reached End of Life in April 2019. This preset is not maintained and should not be used for new projects. ↓
fix Use a modern Babel preset like @babel/preset-env with target 'node 10' or higher.
gotcha Does not include full ES2015 coverage; only trailing commas and CommonJS modules are transpiled. Other missing features (e.g., Symbol, Proxy) are not polyfilled. ↓
fix Add babel-polyfill or @babel/polyfill for complete ES2015 support.
breaking Requires Babel 6.x. Incompatible with Babel 7.x (now @babel/... packages). ↓
fix Use @babel/preset-env with Babel 7 instead.
Install
npm install babel-preset-node6 yarn add babel-preset-node6 pnpm add babel-preset-node6 Imports
- preset (via config) wrong
{"presets": ["babel-preset-node6"]}correct{"presets": ["node6"]} - preset (via Node API) wrong
require("babel-preset-node6")correctrequire("babel-core").transform("code", { presets: ["node6"] }) - preset (via CLI) wrong
babel script.js --presets babel-preset-node6correctbabel script.js --presets node6
Quickstart
{
"presets": ["node6"]
}