本文介绍了找不到在Visual Studio 2015年更新模块'angular2 /核心“1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我碰到这个错误的找不到模块'angular2 /核心尝试在 angular2公测时版本的Visual Studio 2015更新1 来了

在code是如下:

 进口从angular2 /芯{}组件@零件({
    选择:我的应用,
    模板:'< H1>我的第一角2应用< / H1>'
})
出口类AppComponent {
}

我有 angular2测试版的版本在我的 Visual Studio的ASP.NET 5 的项目。我曾经也使建设项目时编译TS文件。

这是我尝试过,但没有工作几件事情:


  1. 我加入 ///<参考路径=../ node_modules / angular2 / core.d.ts/> 在的顶部的 TS 文件。

2

 进口{}组件从angular2 /包/ angular2@零件({
    选择:我的应用,
    模板:'< H1>我的第一角2应用< / H1>'
})
出口类AppComponent {
}

3。

 进口从../node_modules/angular2/core{}组件@零件({
    选择:我的应用,
    模板:< H1>我的第一角2应用< / H1>中
})
出口类AppComponent {
}

更新:

这是我的tsconfig.json

  {
  compilerOptions:{
    noImplicitAny:假的,
    noEmitOnError:真实,
    removeComments:真实,
    sourceMap:真实,
    目标:ES6
    模块:系统
    emitDecoratorMetadata:真实,
    experimentalDecorators:真
  },
  排除:[
    node_modules
    wwwroot的
    bower_components
  ]
}

更新:

我添加的moduleResolution:节点 tsconfig.json 文件,但现在我得到另一套错误的:

解决方案

find the browser.d.ts file under your typings folder and drag into your app.ts or any ts file in your project.you will get the ///reference xxxx, some error should be resolved

这篇关于找不到在Visual Studio 2015年更新模块'angular2 /核心“1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:51