Typescript 2.0 找不到模块
Typescript 2.0 Cannot Find Module
我使用 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
找不到模块错误?
我已经多次重启我的编辑器,但无济于事。
Typescript 2.0
您需要告诉 vscode 才能使用它。请设置 tssdk
more
更多
也可以在命令行上尝试 tsc
。如果它在命令行上出错,那么它在 vscode 中出错,您需要仔细检查代码...在 github 等
上共享 tsconfig.json / 项目
我使用 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
找不到模块错误?
我已经多次重启我的编辑器,但无济于事。
Typescript 2.0
您需要告诉 vscode 才能使用它。请设置 tssdk
more
更多
也可以在命令行上尝试 tsc
。如果它在命令行上出错,那么它在 vscode 中出错,您需要仔细检查代码...在 github 等