找不到模块@ angular/core + angular2

编程入门 行业动态 更新时间:2024-10-23 05:37:46
本文介绍了找不到模块@ angular/core + angular2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在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

本文发布于:2023-11-15 10:31:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1593638.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   模块   angular   core

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!