Change port in ng serve

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