You are using ES6 Module syntax.
This means your environment (e.g. node.js) must support ES6 Module syntax.
NodeJS uses CommonJS Module syntax (module.exports
) not ES6 module syntax (export
keyword).
Solution:
babel
npm package to transpile your ES6 to a commonjs
targetor
Examples of CommonJS syntax are (from flaviocopes.com/commonjs/):
exports.uppercase = str => str.toUpperCase()
exports.a = 1