我在一个模块中定义了一个类:
"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 问题,但是当我试图实现它们的解决方案时,我得到了其他错误消息。