BBa*_*ger 3 node.js npm angular
我有一些脚本package.json,我需要知道如何让start脚本正确接受-portangular-cli 的参数.
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Run Code Online (Sandbox Code Playgroud)
我们需要这个,因为我们想同时运行我们软件的多个实例.目前,如果我有一个项目在默认端口4200上运行,并尝试npm start -port 4300在第二个终端窗口中运行,我得到,"端口4200已经在使用中.使用'--port'指定不同的端口."
我该怎么做才能让我的构建在特定端口运行?我怎么能这样做,以便我可以从命令行将端口号传递到npm启动脚本?
把它改成,
"scripts": {
"ng": "ng",
"start": "ng serve --port 4301",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6121 次 |
| 最近记录: |