1
私はNode.jsのnode index.js
は、次のエラーを発生させ、なぜ疑問に思っています:使用importキーワードは、6
(function (exports, require, module, __filename, __dirname) { import * as math from "lib/math";
^^^^^^
SyntaxError: Unexpected token import
at Object.exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:160:18)
at node.js:456:3
はさえ、node -v
は6.2.1
を示しています。