【发布时间】:2021-12-23 02:08:13
【问题描述】:
我有一个从 github 克隆并使用 npm install 安装的示例 typscript 项目。
在 index.ts 中,我正在尝试导入第三方模块 (https://github.com/ScatterCo/Depthkit.js)。该模块已使用npm install depthkit下载到node_modules文件夹中
要导入我尝试过的模块
import {DepthKit} from 'depthkit/build/depthkit';
或import * as DK from 'depthkit/build/depthkit';
但是当我运行 var depthkit = new DepthKit(); 或 var depthkit = new DK.DepthKit();
我收到一个错误Uncaught TypeError: depthkit_1.DepthKit is not a constructor
我该如何解决这个问题?
【问题讨论】:
标签: typescript import module