Use:
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/register": "^7.0.0"
}
File .babelrc
{
"presets": ["@babel/preset-env"]
}
Entry point for the Node.js application:
require("@babel/register")({})
// Import the rest of our application.
module.exports = require('./index.js')
See How To Enable ES6 Imports in Node.js