How To Create An Angular Project

In this tutorial, we will learn how to set up Angular Development Environment and create a sample Angular project.

In this tutorial, we will learn how to set up Angular Development Environment and create a sample Angular project.

Steps

  1. We have to install the latest version of Node.js. Node is a runtime environment for executing JavaScript code outside the browser. Node provides tools which we need for building Angular projects.

For installing Node, visit https://nodejs.org and download the latest version. An MSI installer package will be downloaded, install it.

You can check the version of Node by using the following command in command prompt :

node --version

Angular

  1. After installing node, we can install Angular CLI.

npm install –g @angular/cli

Angular

You can check the version by using below command.

ng -- version

Angular

  1. Download and install Visual Studio Code. Visit https://code.visualstudio.com
  2. Create a new project.

ng new First-Project

Angular

Angular

  1. Sometimes, you will encounter with an error in project creation.

"npm install fails in windows using fsevents (error code 4048)."

Generally, it happens with the latest version of npm. You need to revert to an older version.

Use the below command for this.

npm install -g npm@5.0.4

Angular

After reverting to the old version, try creating the project again.