【问题标题】:Typescript 2.0 Cannot Find ModuleTypescript 2.0 找不到模块
【发布时间】:2016-07-14 07:46:27
【问题描述】:

我使用 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 themodule not found` 错误?

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

【问题讨论】:

    标签: typescript typescript2.0


    【解决方案1】:

    打字稿 2.0

    你需要告诉 vscode 使用它。请设置tssdkmore

    更多

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

    【讨论】:

      猜你喜欢
      • 2019-08-16
      • 2016-09-20
      • 2016-10-24
      • 2018-11-19
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-31
      相关资源
      最近更新 更多