【发布时间】:2017-09-18 14:04:14
【问题描述】:
我正在运行节点版本 6.10.2 我正在尝试运行这段代码
import * as events from "events"
class MyClass extends events.EventEmitter {
constructor(x, y){
this.x = x;
this.y = y;
}
compute(){
return this.x * this.y;
}
}
var vow = new MyClass(2,3);
vow.compute();
我收到这个错误,我怎样才能让它运行?
SyntaxError: 意外的令牌导入
【问题讨论】:
标签: javascript node.js ecmascript-6