如何更改NPM运行手表的端口



我正在尝试使用npm run watch观察开发。但它移至http://localhost:3000而不是http://localhost:8080。如何将此端口3000更改为8080?因为我在8080端口中使用了Tomcat服务器。

[BS] Proxying: http://localhost:8080
[BS] Access URLs:
 -----------------------------------------------------------------------
       Local: http://localhost:3000/server1/demo3/index.html
    External: http://192.168.126.1:3000/server1/demo3/index.html
 -----------------------------------------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.126.1:3001
 -----------------------------------------------------------------------

更新bs-config.json文件:

eg:

 {
  "port": 8000,
  "files": ["./src/**/*.{html,htm,css,js}"],
  "server": { "baseDir": "./src" }
}

但是,对于Angular2-CLI的情况,您需要在端口参数上提供:

ng serve --port 8000

最新更新