2016-01-13 28 views
0

我有一个带有tsconfig.json的打字稿项目,并且所有节点模块导入都有错误找不到模块。我错过了什么?适当的模块安装在node_modules文件夹,执行TSC正常工作TS Project - 无法找到模块

进口为例:import {Component, Inject} from 'angular2/core';

tsconfig.json:

{ "compilerOptions": { "target": "es5", "module": "commonjs", "experimentalDecorators": true, "experimentalAsyncFunctions": true, "emitDecoratorMetadata": true, "noImplicitAny": false, "moduleResolution": "node" }, "exclude": [ "node_modules", "dist" ] }

回答

0

我能够通过从我的tsconfig.json中删除以下行来修复它。 TSC CLI告诉我这是一个问题。

"experimentalAsyncFunctions": true,

0

这将是有益的,看看你的文件夹结构验证您的设置是否正确。

你似乎缺少的是angular2的tsd文件。

npm install -g tsd tsd query angular2 --action install

退房的VS Code docs更多信息。