问题:An unhandled exception occurred: Port 4200 is already in use. Use '--port' to specify a different port.

意思是端口4200已在使用中,使用“-port”指定其他端口。

解决方法:

1.修改配置文件:node_modules/angular-cli/lib/config/schema.json 

Ctrl+f快捷键弹出搜索框,搜索4200,修改为其他端口号,保存重启项目就不会有问题了

优点:永久性的

缺点:操作麻烦

angular修改启动端口

 

2. 使用命令:ng serve --port 端口号

优点:操作简单

缺点:一次性的,下次启动项目仍然需要修改端口号

相关文章:

  • 2021-12-01
  • 2021-11-23
  • 2021-10-21
  • 2021-05-18
  • 2022-12-23
  • 2021-11-01
  • 2021-04-10
  • 2021-09-23
猜你喜欢
  • 2022-12-23
  • 2021-11-11
  • 2021-07-06
  • 2021-10-08
  • 2021-05-19
  • 2022-01-14
  • 2021-05-19
相关资源
相似解决方案