Installation

How to change the default 4200 port in Angular ng serve

Changing the default 4200 port is an easy task in your Angular project. Using the --port option when you run ng serve passing as parameter the preferred port, you can access your project on another port from the default.

You can also define the command in your package.json file to avoid adding --port option every time you run ng serve

 

        
    

As soon as you have the Angular cli package installed you can create a new project using the ng new project command.

        
    

How to install Angular command line interface

In order to use the Angular command in terminal or command prompt you have to install the Angular cli package. You can use the NPM to easily install it.