Use ES6 'import' statement without transpilers

Viewed 1078

I have nodejs v8

$ node -v
v8.1.3

and a script:

import cmd from "commander";

There is an error "Unexpected token import" when I try to launch this script:

$ node script.js
/.../script.js:1
(function (exports, require, module, __filename, __dirname) { import cmd from "commander";
                                                              ^^^^^^

    SyntaxError: Unexpected token import

Does any method exist to use ES6 modules ("import" statement) without transpiler?

2 Answers
Related