Angular 修改端口

1)去对应的文件里面修改代码,angular的版本不同,可能目录也不同。如下:

angular5中,/nodemodules/@angular/cli/lib/config/schema.json

"serve": {
"description": "Properties to be passed to the serve command.",
"type": "object",
"properties": {
"port": {
"description": "The port the application will be served on.",
"type": "number",
"default": 4200 //修改之
}

2)直接命令行修改

ng server --port 4201

原文:https://blog.csdn.net/qq_33242126/article/details/80348341

你可能感兴趣的:(Angular 修改端口)