We have two ways to change the default port number in Angular.
The first way to cli command:
ng serve --port 2400 --open
The second way is to configure in the location: ProjectName\node_modules\@angular-devkit\build-angular\src\dev-server\schema.json .
Make changes to the schema.json file.
{ "title": "Dev Server Target", "description": "Dev Server target options for Build Facade.", "type": "object", "properties": { "browserTarget": { "type": "string", "description": "Target to serve." }, "port": { "type": "number", "description": "Port to listen on.", "default": 2400 },
Satyendra Patel Nov 26 '18 at 17:15 2018-11-26 17:15
source share