【发布时间】:2017-11-20 21:25:48
【问题描述】:
我在 Typescript 中有一个项目,我想使用依赖项“localForage”:https://github.com/localForage/localForage。
我是通过以下 npm 命令安装的:
npm install @types/localforage --save
我用过:
import * as localForage from "localforage";
我得到了错误:
错误 TS1148:除非“--module”标志为 前提是我正在寻找解决方案并且我找到了 TypeScript 0.9.* VisualStudio TS5037:无法编译外部模块,除非 提供了“--module”标志。
这与我无关,因为我使用的是 Webstorm 10.0.5
【问题讨论】:
-
你需要实际安装模块 -
npm i localforage- @types 包只是打字稿定义 -
我试过了。没有帮助
-
我开了一个新问题。这个可以删除。
标签: typescript webstorm typescript-typings localforage