The following gulpfile.babel.js works without errors when started with the babel-node gulpfile.babel.js (I know that gulp-tasks are started with commands like gulp taskname , and babel-node gulpfile.babel.js needed only for debugging purposes, including when the task itself is not yet written).
require('@babel/register'); import gulp from 'gulp'; gulp.task('default', done => { console.log('No problem!'); done(); }); If you import a module ( node-modules/my-config-helper/index.js in this example), which also contains the import and export keywords, the application will SyntaxError: Unexpected token export with a SyntaxError: Unexpected token export error.
require('@babel/register'); import gulp from 'gulp'; import ConfigHelper from 'my-config-helper'; node-modules / my-config-helper / index.js
require('@babel/register'); export default class ConfigHelper { constructor() { console.log('ConfigHelper: done'); } } It follows that require('@babel/register'); does not extend to other files. What then should be done? Simple installation of babel-core and babel-register in the my-config-helper folder will not remove errors.