Answers for "how to change vue server port"

1

how to run vue js project on different port

npm run serve -- --port 3000
Posted by: Guest on July-07-2021
0

How to change port number in vue-cli project

with Vue CLI v3
package.json: Add port option to serve script: 
	vue-cli-service serve --port xxxx

Example:
in file package.json edit 
scripts": {
    "serve": "vue-cli-service serve
    ........
}

to


scripts": {
    "serve": "vue-cli-service serve --port 3000",
    .........
}    

OR

CLI Option --port to npm run serve, e.g. npm run serve -- --port 3000. 
Note the --, this makes passes the port option to the npm script 
instead of to npm itself. Since at least v3.4.1, 
it should be e.g. vue-cli-service serve --port 3000
Posted by: Guest on February-10-2021

Code answers related to "how to change vue server port"

Code answers related to "Javascript"

Browse Popular Code Answers by Language