Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Angular 2 using NPM?

I'm trying to setup my own local development environment for an Angular 2 app without using the QuickStart seed mentioned in the Angular 2 site or the Angular CLI because they tend to come with extra files that I don't really require.

Now, everything's going fine except that I don't know how to get Angular 2 using NPM. I've tried using npm install angular2 --save but I just found out that angular2 has been deprecated and was a pre-release version. So I guess how do I get the latest Angular 2.0 plugins using NPM, if at all possible at the moment?

like image 597
pdanem Avatar asked Jan 21 '17 17:01

pdanem


People also ask

How do I download Angular CLI using npm?

Install Angular CLI (Angular command line interface) Open the link https://cli.angular.io/ and follow the instructions to install Angular CLI and to create your first Angular app. Type the command “npm install -g @angular/cli” on the command prompt and press enter to install Angular cli.


1 Answers

at https://angular.io/docs/ts/latest/guide/setup.html, is recommended to use QuickStart seed, here is its package.json, so actually we need to download its dependencies:

"dependencies": {
  "@angular/common": "~2.4.0",
  "@angular/compiler": "~2.4.0",
  "@angular/core": "~2.4.0",
  "@angular/forms": "~2.4.0",
  "@angular/http": "~2.4.0",
  "@angular/platform-browser": "~2.4.0",
  "@angular/platform-browser-dynamic": "~2.4.0",
  "@angular/router": "~3.4.0",

  "angular-in-memory-web-api": "~0.2.4",
  "systemjs": "0.19.40",
  "core-js": "^2.4.1",
  "rxjs": "5.0.1",
  "zone.js": "^0.7.4"
}

you could also create your custom package.json, by running npm init, copying these dependencies (or most of them) and than running npm install with your package.json

like image 196
Andriy Avatar answered Sep 18 '22 16:09

Andriy