我在模块中定义了一个类:
"use strict";
var AspectTypeModule = function() {};
module.exports = AspectTypeModule;
var AspectType = class AspectType {
// ...
};
module.export.AspectType = AspectType;
但我收到以下错误信息:
TypeError: Cannot set property 'AspectType' of undefined
at Object.<anonymous> (...\AspectType.js:30:26)
at Module._compile (module.js:434:26)
....
我应该如何导出这个类并在另一个模块中使用它?我见过其他SO问题,但当我try 实现它们的解决方案时,我会收到其他错误消息.