Site icon Tutorial

Angular Installation

Go back to Tutorial

The Angular CLI, Angular applications, and Angular itself depend upon features and functionality provided by libraries that are available as npm packages.

You can download and install these npm packages with the npm client, which runs as a node.js application.

The yarn client is a popular alternative for downloading and installing npm packages. The Angular CLI uses yarn by default to install npm packages when you create a new project.

Prerequisites

Before you begin, make sure your development environment includes Node.js® and an npm package manager.

To start working with Angular, you need to get the following key components installed.

The Angular CLI

The Angular CLI is a tool to initialize, develop, scaffold and maintain Angular applications. To install the Angular CLI (Command Line Interface) tool, which helps you start new Angular 7 projects as well as assist you during development, you will need Nodejs. Make sure you install this with the default options and reload your command line or console after doing so.

Install the Angular CLI – You use the Angular CLI to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment. Install the Angular CLI globally. To install the CLI using npm, open a terminal/console window and enter the following command: npm install -g @angular/cli

package.json

Both npm and yarn install packages identified in a package.json file. The CLI ng new command creates a default package.json file for your project. This package.json specifies a starter set of packages that work well together and jointly support many common application scenarios. You will add packages to package.json as your application evolves. You may even remove some.

dependencies and devDependencies

The package.json includes two sets of packages, dependencies and devDependencies. The dependencies are essential to running the application. The devDependencies are only necessary to develop the application.

The dependencies section of package.json contains:

Angular Packages

Polyfill packages

Many browsers lack native support for some features in the latest HTML standards, features that Angular requires. “Polyfills” can emulate the missing features. The default package.json installs the core-js package which polyfills missing features for several popular browser.

Support packages

DevDependencies

The packages listed in the devDependencies section of the package.json help you develop the application on your local machine. You don’t deploy them with the production application although there is no harm in doing so.

 

Go back to Tutorial

Exit mobile version