更改angular的默认端口

一、现象

当本地同时运行了多个angular项目时,端口占用问题

Port 4200 is already in use. Use '--port' to specify a different port.

二、解决

1、相应找到以下目录 node_modules/@angular/cli/lib/config/ 中的 schema.json

2、搜索到到默认的“4200”(大概509行)

3、把4200 改为其它的没有被占用的端口,如6200 

三、总结

一般这种端口是在自身客户端中设置的,优先从相应的地方进行查询会更快捷。

原文地址:https://www.cnblogs.com/waitingbar/p/7511707.html