Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
207 views
in Technique[技术] by (71.8m points)

node.js - 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.

I have npm installed angular2(2.0.0-beta.17) and typescript

npm install angular2
npm install -g typescript

In my main.ts am importing

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

For the above line editor is displaying "Can not find module '@angular/core".

What is that I am missing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Angular2 no longer uses the package angular2, but rather a list of different packages under the tag @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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...