我正在尝试在Visual Studio 2015中使用Typescript创建Angular 2应用程序.我已经在计算机上安装了npm.编译应用程序时,出现错误,找不到模块'@ angular/core'. 在import语句的node_modules文件夹下的所有ts文件中都引用了该文件. 例如
import { ElementRef, AfterViewInit, OnDestroy, DoCheck, EventEmitter, IterableDiffers } from '@angular/core';我目前遇到500多个错误.当我将其替换为"angular2/core"时,该错误消失.也是为了让您知道,我也在项目中使用了PrimeNG UI组件.
有人可以帮忙吗?我不明白为什么要看@ angular/core吗?
解决方案模块名称中的angular2名称适用于RC(候选发布版)之前的版本(测试版),而@angular适用于RC版本./p>
I am trying to create an Angular 2 application using Typescript in Visual Studio 2015. I have installed npm on my machine. When I compile my application , I am getting errors cannot find module '@angular/core'. It is referred in all the ts files under the node_modules folder in the import statement. For e.g.
import { ElementRef, AfterViewInit, OnDestroy, DoCheck, EventEmitter, IterableDiffers } from '@angular/core';I am currently getting around 500 plus errors. The error goes off when I replace it with 'angular2/core '. Also just to let you know , I am using PrimeNG UI Components in my project as well.
Could somebody help ? I don't understand why it is looking at @angular/core ?
解决方案The angular2 name in modules names is for versions before RC (release candidate) versions (beta ones) and the @angular one for RC versions.
更多推荐
找不到模块@ angular/core + angular2
发布评论