Issue
I have some scripts in my package.json
, and I need to know how to get the start
script to correctly accept the -port
parameter for angular-cli.
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
We need this because we would like to run multiple instances of our software simultaneously. Currently, if I have one project running on the default port 4200, and try to run npm start -port 4300
in a second terminal window, I get, "Port 4200 is already in use. Use '--port' to specify a different port."
What can I do to get my build to run in a particular port? And how can I make it so that I can pass the port number into the npm start script from the command line?
Solution
If you add "--" the parameters are passed through:
npm start -- --port 4301
Answered By - Cocaux
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.