Javascript Import关键字返回了Unexpected token
- 论坛
- Javascript Import关键字返回了Unexpected token
14 浏览
Javascript Import关键字返回了Unexpected token
我不明白出了什么问题。
Node版本:v5.6.0
NPM版本:v3.10.6
代码:
function (exports, require, module, __filename, __dirname) { import express from 'express' };
错误信息:
SyntaxError: 意外的 import 标记 at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:140:18) at node.js:1001:3