angular-cli修改端口号

找到node_modules/angular-cli/lib/config/schema.json
default值就是默认的端口

"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
      },
      "host": {
        "description": "The host the application will be served on",
        "type": "string",
        "default": "localhost"
      }
    }
  }
}

也可以通过命令行方式修改,如:

ng serve --port 4201
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,188评论 19 139
  • 一、解决被墙的问题 方法1:设置代理 npm config set proxy=http://127.0.0.1:...
    chenhongbinjs阅读 8,466评论 4 48
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,172评论 6 342
  • Angular CLI 是什么? Angular CLI 是一个命令行接口(Command Line Interf...
    semlinker阅读 9,689评论 0 39
  • 如果能够以原则为基础,以第二类事务为生活中心,对一个星期内的事务进行具体安排,将有助于更好地理解第四代时间管理的原...
    Fly_Catkin阅读 1,769评论 0 0

友情链接更多精彩内容