How to Install NodeJS using Angular CLI

Posted by

In this lesson, we are going to discuss How to Install NodeJS using Angular CLI. In the first part of this lesson, we will discuss, how Angular 4 works. In the second part we will tell you how to install the NodeJS, and in the third part, we will discuss how to install Angular CLI.

The following stuff are required to work on Angular 4 project

  • NodeJS
  • Npm
  • Angular CLI
  • IDE to write code

NOTE:

This is to be noted that Npm has to be greater than 3 and NodeJS has to be greater than 4.




I will recommend you to watch all the tutorials before proceeding to read the article. Watch the below tutorials to clearly understand, How to setup environment for Angular 4. The first part will clear your mind on Angular CLI and in the Second part NodeJS will be download and Install, in third part you will learn Angular CLI installation. Let’s watch the first Tutorials.

Part 1: In this first part, you will learn How Angular 4 works. Watch the tutorial till the end and proceed to Part 2.

https://youtu.be/IjyBk82-CX0

This is to be noted that Npm has to be greater than 3 and NodeJS has to be greater than 4.




Part 2: How to Download and Install NodeJS. Watch the tutorial till the end and move to Part 3.

https://youtu.be/2-soRJYIFLY

Installing NodeJS

NodeJS.org of nodeJS and download the latest version. Install the package based on your OS.

The front end of NodeJS official website looks like:

nodejs

Install the required package, based on your operating system. Once NodeJS is Installed, Npm will also get installed with it automatically. Then for confirmation, check if the Npm is installed or not. For this open terminal and type –v, it will display the current version of Npm installed.

E.g:

C:\>npm –v 
5.3.0

This is to be noted that Npm has to be greater than 3 and NodeJS has to be greater than 4.




Also Read  What is the components in Angular 4

Part 3: How to Install Angular CLI. Watch the tutorial till the end. It will clear all your confusion.

https://youtu.be/EuQ5ST13Vgs

Installation of Angular 4 is very easy with the help of Angular CLI. To install Angular 4, first go to the official website of Angular by typing the following URL to get the command from there. The official website of Angular is https://cli.angular.io

See the below screenshot for an example:

Angular cli

To install Angular CLI, use the following command:

Type npm install –g @angular/cli, to install angular cli on your system.

npm command

To open directory, use the following command:

Type cd directory-name, where directory-name is your project directory.

open directory

To create a new project directory, use the following command:

Type ng new my-dream-app, where my-dream-app is your project name.

create new project directory

After clicking enter, you will see that the installation will get started, see the below image to get an idea:

Installation of Angular 4

Once the installation is done. Then you can use any IDE of your choice like Atom, Visual Studio Code or WebStorm, etc.

This is to be noted that Npm has to be greater than 3 and NodeJS has to be greater than 4.




To open project, use the following command:

Type cd my-dream-app, where my-dream-app is your project directory.

open Angular 4 Project

To start Angular CLI, use the following command:

Type ng serve

ng serve command

That all you need to do. Now you can open your Angular 4 project by typing the localhost:4200 on your browser like:

How to Install NodeJS using Angular CLI

This is to be noted that Npm has to be greater than 3 and NodeJS has to be greater than 4.




Also Read  How to Run First Application in Angular 4

That,s all we have in this lesson, How to run first app in Angular 4 is next. Thank you for now.

3 comments

Leave a Reply

Your email address will not be published. Required fields are marked *