Installing and configuring Angular 5 project

Sharad Jaiswal
Sharad Jaiswal

Posted On: Sep 02, 2018

Installing and configuring Angular 5 project

 

Requirements To install Angular 5

In order to install and run Angular 5 CLI Version, you have to install the following elements in your environment.

  • Node.js (Node 4 or higher)
  • npm (NPM 3 or higher)
  • Angular CLI

Installing Nodejs latest version

If you are PC(Window) or OS X (Mac) user then you can install the latest version of the node from Node official website
https://nodejs.org/en/download/ using one of the installers and follow the steps.
For linux please follow this tutorial Installing Nodejs on Ubuntu

Checking installed version of Node
node -v

Update npm

Installing node will install npm automatically, however version of npm is updated more frequently then Node. It is recommended to update your npm to latest available version. To update your npm version run below command on your terminal or command prompt.

npm install npm@latest -g

You may also Like Angular 5 interview questions

Installing Angular CLI

After installing Node js and updating your npm the next step is to install Angular CLI. Angular CLI is Command line interface for creation and managing Angular applications. It based on the ember-cli project. To install angular cli run below command on your terminal.

npm install -g angular-cli

Creating Angular 5 Project.

To create Angular 5 Project run following commands

ng new myApp --skip-install

You can create an angular project by running ng new yourprojectname command, we have added --skip-install option we angular 5 is not released yet offically. --skip-install option tells NPM to skip the project dependencies to install automatically. We will install our dependencies manually by updating projects package.json

Also, Read Best Node JS Interview Questions

Once installation of the Angular project is completed successfully, change your directory to projects directory.

cd myApp

Next, open your package.json and replace all angular dependencies from ^4.2.4 to ^5.0.0-rc.1 and Typescript ~2.3.3 to ~2.4.1 and save it.

Now come back on your terminal and run below command to install all project dependencies

npm install

Running your Angular 5 project

To running your Angular 5 project, rum below command on command prompt

ng serve

Output:** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

The ng serve command launches the server watches your files and rebuilds the app as you make changes to those files.

Open http://localhost:4200/ URL in your browser to browse the App.

Angular 5 app installation

    Please Login or Register to leave a response.

    Related Articles

    Angularjs Tutorials

    Angular 5 Modal dialog example

    Read how to add delete confirm box in Angular 4, Angular 5, Angular 6 modal dialog popup. In this article, we are going to see how to add a delete confirmation box in Angular Js we are using ngx-moda..

    Angularjs Tutorials

    Why Angular JS is one of the popular JavaScript frameworks

    Why Angular JS is one of the popular JavaScript frameworks. In this article read about the key features of Angular Framework. In the era of the online shopping, every fact wants to create their presen..

    Angularjs Tutorials

    Top 10 AngularJS Interview Questions for Experience

    In case you're searching for top 10 AngularJS Interview Questions online, look no further and dive straight into the basics that usually the panelists ask during an interview.Many corporates and M..

    Ask a Question