Nodejs and ES6
in Node.js / Javascript on ES6 - Hits()
Times when I use ES6 feature in nodejs and run it, encounter the problem of “SyntaxError: Unexpected token import”
nodejs official document have elaberate it at here
if you want some ES6 feature that not stable in V8 engine, use –harmony flag but not recommend.
see the feature and support of the v8 version.
About ES6 Module. from here https://nodejs.org/api/esm.html#esm_supported, the import syntax have not been supported yet.
but you can use babel to use the import/export syntax.