简体   繁体   English

找不到模块'@ angular / core'错误

[英]Can not find module '@angular/core' error

I am working on a basic Angular2 sample using NodeJS , and the editor i am using is atom. 我正在使用NodeJS进行基本的Angular2示例,而我使用的编辑器是atom。

I have npm installed angular2(2.0.0-beta.17) and typescript 我已经安装了npm的angular2(2.0.0-beta.17)和打字稿

npm install angular2
npm install -g typescript

In my main.ts am importing 在我的main.ts中正在导入

import { Component } from '@angular/core';

For the above line editor is displaying "Can not find module '@angular/core". 对于上面的行,编辑器显示“找不到模块'@ angular / core”。

What is that I am missing. 我想念的是什么。

Angular2 no longer uses the package angular2 , but rather a list of different packages under the tag @angular . Angular2不再使用包angular2 ,而是使用标签@angular下的一系列不同包。 This list includes, but is not limited to: 此列表包括但不限于:

  • @angular/common
  • @angular/core
  • @angular/compiler
  • @angular/forms
  • @angular/platform-browser
  • @angular/platform-browser-dynamic

Please refer to the 5 Min Quickstart Guide for further details. 有关更多详细信息,请参阅5分钟快速入门指南

Angular2 used the angular2 package up until the release candidate , when it introduced a breaking change by moving the different modules to their own packages, and all of these under the new @angular tag. Angular2一直使用angular2包,直到发布候选版本为止,当时它通过将不同的模块移动到它们自己的包中并将所有这些都放在新的@angular标记下进行了重大更改

Package name for angular core is @angular/core. 角核的软件包名称为@ angular / core。

Read quick start guide regarding all the packages needed for angular 2. 阅读有关角度2所需的所有包装的快速入门指南

Hope this helps!! 希望这可以帮助!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:找不到模块'jasmine-core' - Error: Cannot find module 'jasmine-core' 错误:找不到模块“ @ angular / compiler” - Error: Cannot find module '@angular/compiler' 找不到模块 node-sass angular 7 - can not find module node-sass with angular 7 Angular 2-节点-gulp | 找不到模块.component - Angular 2 - Node - gulp | can not find module .component Typescript 编译器错误 TS2307:从没有 NPM 的 CDN 加载时找不到模块“angular2/core” - Typescript Compiler Error TS2307: Cannot find module "angular2/core" when loading from CDN without NPM .NET Core 2.0 和 Angular 初始应用程序构建失败 - 找不到 python,后面跟着 JavaScript 运行时错误 - .NET Core 2.0 & Angular Initial app build fails - Can't find python followed by JavaScript Runtime Error 错误在运行应用程序时无法解析模块@angular/core 错误 - ERROR in Could not resolve module @angular/core error while run app npm run start引发错误。 找不到模块angular-cli - npm run start throws an error. Can't find module angular-cli 找不到模块“@angular-devkit/build-angular” - Can not find module “@angular-devkit/build-angular” Heroku上的mongodb驱动程序错误:找不到模块'mongodb-core' - Error with mongodb driver on Heroku: Cannot find module 'mongodb-core'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM