3

我使用 VS Code 1.3.0 作为编辑器和 Typescript 2.0。我的tsconfig.json根目录中有一个文件属性, "files":["newfile.ts"]并且newfile.ts位于我的根目录中。我运行 npm i --save lodash npm i @types/lodash --save并安装了定义文件。在我的 newfile.ts 中找不到 import * as _ from "lodash" and I'm getting a module not found error on lodash. If lodash and its type are installed, why the模块错误?

我已经多次重新启动我的编辑器,但无济于事。

4

1 回答 1

2

打字稿 2.0

你需要告诉 vscode 使用它。请设置tssdk 更多

更多的

tsc也可以在命令行上尝试。如果它在命令行上出错,那么它在 vscode 中是一个错误,你需要仔细检查代码......在 github 上分享 tsconfig.json / 项目等

于 2016-07-13T23:46:27.203 回答