我在Typescript中有一个项目,我想使用依赖项“localForage”:https://github.com/localForage/localForage。如何在Typescript项目中使用“localForage”?
npm install @types/localforage --save
我用:
我用以下命令故宫安装了
import * as localForage from "localforage";
,我得到的错误:
error TS1148: Cannot compile modules unless the '--module' flag is provided I was looking for solutions and I found TypeScript 0.9.* VisualStudio TS5037: Cannot compile external modules unless the '--module' flag is provided.
这是不相关的我因为我用Webstorm 10.0.5
你需要实际安装的模块中遇到的问题 - 'NPM我localforage' - @types包只是打字稿定义 – Seiyria
我试过了。没有帮助 – CrazySynthax
我开了一个新问题。这个可以删除。 – CrazySynthax